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 -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -