Created
August 12, 2018 14:52
-
-
Save crummy/b8bf017ae152739eb6aa81394c0cac43 to your computer and use it in GitHub Desktop.
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
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