Last active
December 27, 2019 16:38
Star
You must be signed in to star a gist
Python Zip 1
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
numList = [0, 1, 2] | |
engList = ['zero', 'one', 'two'] | |
espList = ['cero', 'uno', 'dos'] | |
print(list(zip(numList, engList, espList))) | |
# [(0, 'zero', 'cero'), (1, 'one', 'uno'), (2, 'two', 'dos')] | |
for num, eng, esp in zip(numList, engList, espList): | |
print(f'{num} is {eng} in English and {esp} in Spanish.') | |
# 0 is zero in English and cero in Spanish. | |
# 1 is one in English and uno in Spanish. | |
# 2 is two in English and dos in Spanish. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cool instructional post, using all of our favourite python features. Especially if you're writing for beginners, could you please check out and follow PEP-8 style guide so people can learn from the outset? Thanks!
https://www.python.org/dev/peps/pep-0008/#function-and-variable-names