Skip to content

Instantly share code, notes, and snippets.

@edenau
Last active December 27, 2019 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edenau/34fabb07f38dde6b186724f85bd1e7b8 to your computer and use it in GitHub Desktop.
Save edenau/34fabb07f38dde6b186724f85bd1e7b8 to your computer and use it in GitHub Desktop.
Python Enumerate
upperCase = ['A', 'B', 'C', 'D', 'E', 'F']
lowerCase = ['a', 'b', 'c', 'd', 'e', 'f']
for i, (upper, lower) in enumerate(zip(upperCase, lowerCase), 1):
print(f'{i}: {upper} and {lower}.')
# 1: A and a.
# 2: B and b.
# 3: C and c.
# 4: D and d.
# 5: E and e.
# 6: F and f.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment