Skip to content

Instantly share code, notes, and snippets.

@studiawan
Last active March 11, 2021 04:58
Show Gist options
  • Save studiawan/6634481 to your computer and use it in GitHub Desktop.
Save studiawan/6634481 to your computer and use it in GitHub Desktop.
Simple python loop
# pay attention to code indentation
# python uses indentation, not curly brackets like in C
# print 0 to 4
for i in range(5):
print(i)
# print 0 to 4 too
i = 0
while i < 5:
print(i)
i = i + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment