Skip to content

Instantly share code, notes, and snippets.

@studiawan
Last active March 11, 2021 06:15
Show Gist options
  • Save studiawan/6710911 to your computer and use it in GitHub Desktop.
Save studiawan/6710911 to your computer and use it in GitHub Desktop.
Simple Python branching
i = 5
# check i value
if i == 5:
print("It is 5")
else:
print("It is not 5")
# print 5 to 9 and say hello when it is 7
for i in range(5, 10):
if i == 7:
print("Hello... it is 7")
else:
print(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment