Last active
June 16, 2022 04:01
-
-
Save plavjanik/eb244afa008948151e0a7b36ff0a1f50 to your computer and use it in GitHub Desktop.
Looping over a range of numbers
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
| # ❌ | |
| i = 0 | |
| while i < 6: | |
| print(i) | |
| i += 1 | |
| # ❌ | |
| for i in [0, 1, 2, 3, 4, 5]: | |
| print(i) | |
| # ✔️ | |
| for i in range(6): | |
| print(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment