Skip to content

Instantly share code, notes, and snippets.

@crummy
Created August 12, 2018 14:52
Show Gist options
  • Save crummy/b8bf017ae152739eb6aa81394c0cac43 to your computer and use it in GitHub Desktop.
Save crummy/b8bf017ae152739eb6aa81394c0cac43 to your computer and use it in GitHub Desktop.
given:
a = 1
b = 2
------------
if (a == 1):
print "a is 1"
if (b == 2):
print "b is 2"
# result: both lines are printed
------------
if (a == 1):
print "a is 1"
elif (b == 2):
print "b is 2"
# result: ONLY the first line is printed - because of the "else" in elif. "do this, else do this."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment