Skip to content

Instantly share code, notes, and snippets.

@Jestre
Created September 4, 2013 22:49
Show Gist options
  • Save Jestre/6443852 to your computer and use it in GitHub Desktop.
Save Jestre/6443852 to your computer and use it in GitHub Desktop.
lucpet's function
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