Created
September 4, 2013 22:49
-
-
Save Jestre/6443852 to your computer and use it in GitHub Desktop.
lucpet's function
This file contains 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
def shit_happens(): | |
if 2 + 2 >= 5: | |
#if shit happens, do this | |
print('woo hoo') | |
elif 2 + 2 >= 4: | |
#if that last didn't happen, do this | |
print('yay') | |
else: | |
""" | |
If none of that happened, do this | |
N.B. No need for any comparison here, if there was | |
no match in the first two, this will fire anyway. If | |
you do want this to fire if (and only if) 2+2<= 3, then | |
use a second elif instead of an else, e.g. | |
elif 2 + 2 <= 3: | |
""" | |
print('WTF') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment