Created
May 5, 2019 14:06
-
-
Save nunenuh/1b29ce884ab720baf6425fc05f8be33a to your computer and use it in GitHub Desktop.
Idiomatic Python
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
# Looping Over Collection Forward | |
colors = ["red", "green", "blue"] | |
# bad | |
for i in range(len(colors)): | |
print(colors[i]) | |
# good | |
for color in colors: | |
print(color) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment