I have a list of lists:
a = [[1, 3, 4], [2, 5, 7]]
I want the output in the following format:
1 3 4 2 5 7
You can do this:
>>> lst = [[1, 3, 4], [2, 5, 7]] >>> for sublst in lst: ... for item in sublst: ... print item, # note the ending ',' ... print # print a newline ... 1 3 4 2 5 7