Skip to content

Instantly share code, notes, and snippets.

@edenau

edenau/python-enumerate.py

Last active Dec 27, 2019
Embed
What would you like to do?
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