Created
October 4, 2015 15:02
-
-
Save poros/0bbd38ade29dd95e64a2 to your computer and use it in GitHub Desktop.
Loop over two collections
This file contains hidden or 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
n = min(len(names), len(colors)) | |
for i in range(n): | |
print names[i], colors[i] | |
for names, color in zip(names, colors): | |
print name, color | |
#collections.izip is the iterator version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment