Skip to content

Instantly share code, notes, and snippets.

@basepi
Created May 23, 2011 03:54
Show Gist options
  • Save basepi/986204 to your computer and use it in GitHub Desktop.
Save basepi/986204 to your computer and use it in GitHub Desktop.
if vs elif
number = 5
# Here, number will print twice
if number < 6:
print(num)
if number < 7:
print(num)
# Here, number will only print once
if number < 6:
print(num)
elif number < 7:
print(num)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment