¡@

Home 

python Programming Glossary: tupleoftuples

How do I convert a tuple of tuples to a one-dimensional list using list comprehension? [duplicate]

http://stackoverflow.com/questions/3204245/how-do-i-convert-a-tuple-of-tuples-to-a-one-dimensional-list-using-list-comprehe

12 answers I have a tuple of tuples for example tupleOfTuples 1 2 3 4 5 I want to convert this into a flat one dimensional.. to accomplish it with a for each loop myList for tuple in tupleOfTuples myList myList list tuple But I feel like there must be a way.. a list comprehension. A simple list tuple for tuple in tupleOfTuples just gives you a list of lists instead of individual elements...