python - convert items within a tuple/list -


i have following list

[(199l, 5l, 247l, 44l), (203l, 5l, 245l, 6l),  (219l, 5l, 196l, 6l)] 

i use list.extend add [222l, 5l, 227l, 5l] list becomes

[(199l, 5l, 247l, 44l), (203l, 5l, 245l, 6l),  (219l, 5l, 196l, 6l), 222l, 5l, 227l, 5l ] 

however in format..

[(199l, 5l, 247l, 44l), (203l, 5l, 245l, 6l),  (219l, 5l, 196l, 6l), (222l, 5l, 227l, 5l)] 

would know how that..?

you looking list.append().

>>> lis = [(199l, 5l, 247l, 44l), (203l, 5l, 245l, 6l),  ... (219l, 5l, 196l, 6l)] >>> lis.append((222l, 5l, 227l, 5l)) >>> lis [(199l, 5l, 247l, 44l), (203l, 5l, 245l, 6l), (219l, 5l, 196l, 6l), (222l, 5l, 227l, 5l)] 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -