Skip to content

Instantly share code, notes, and snippets.

@edenau
Last active December 27, 2019 16:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save edenau/f159058e3d1763ea2ec8cd792e4a8280 to your computer and use it in GitHub Desktop.
Python Zip 1
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.
@tokyodoug
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment