De-tupleizing a list

Littlefield, Tyler tyler at tysdomain.com
Tue Apr 26 05:38:11 CEST 2011


 >What is the most Pythonic way to loop through the list returning a
 >list like this?:

here's how I'd do it:
 >>> i
[(1, 'a'), (2, 'b'), (3, 'c')]
 >>> for item in i:
...     a+=list(item)
...
...
 >>> a
[1, 'a', 2, 'b', 3, 'c']




More information about the Python-list mailing list