This is sort of confusing me because what I seem to need to do is get an item from one list, an item from another list, etc. and then go back to the first list and get another item, etc. I'm having trouble figuring out how to revisit the same lists multiple times.
Here's the list:
table_data = [['apples', 'oranges', 'cherries', 'banana'],
['Alice', 'Bob', 'Carol', 'David'],
['dogs', 'cats', 'moose', 'goose']]
I need to print out this data in the following format:
apples Alice dogs
oranges Bob cats
cherries Carol moose
banana David goose
Thanks!
zip
will generate an iterator that groups elements by their position (index) in the passed iterators. In your case passing*table_data
will "expand" table data into 3 lists that then can be passed tozip