Created
August 19, 2013 17:17
-
-
Save Sourceless/6271614 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def columns(list_of_lists): | |
# Assumes all lists are same length as first, or longer | |
columns = len(list_of_lists[0]) | |
list_of_lists = [iter(list_) for list_ in list_of_lists] | |
for _ in xrange(columns): | |
yield [list_iter.next() for list_iter in list_of_lists] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment