Created
June 16, 2022 04:02
-
-
Save plavjanik/7b530a134050872c4410c7902218a199 to your computer and use it in GitHub Desktop.
Looping over a collection
This file contains hidden or 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
| colors = ["cyan", "magenta", "yellow", "black"] | |
| # ❌ | |
| for i in range(len(colors)): | |
| print(colors[i]) | |
| # ✔️ | |
| for color in colors: | |
| print(color) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment