Created
October 5, 2019 03:38
-
-
Save adrianmarkperea/9305052eac19052d0e43a64d8ddb30d9 to your computer and use it in GitHub Desktop.
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
fruits = ['apples', 'oranges', 'bananas'] | |
# yikes, archaic | |
for i in range(len(fruits)): | |
print(i, fruits[i]) | |
# So much better | |
for i, fruit in enumerate(fruits): | |
print(i, fruit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment