I need to do the opposite of this http://stackoverflow.com/questions/756550/multiple-tuple-to-two-pair-tuple-in-python Namely, I have a list of tuples
[(1,2), (3,4), (5,6)]
[1,2,3,4,5,6]
>>> tot = [] >>> for i in ...
Suppose I have two differently-sized lists
a = [1, 2, 3] b = ['a', 'b']
c
I need to incrementally fill a list or a tuple of lists. Something that looks like this:
result = [] firstTime = True for i in range(x): for j in someListOfElements: ...
query = 'select mydata from mytable' cursor.execute(query) myoutput = cursor.fetchall() print myoutput (('aa',), ('bb',), ('cc',))