Last active
April 2, 2019 08:37
-
-
Save spencerjpotts/d75603b9e823eb302821a67538715f4f to your computer and use it in GitHub Desktop.
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
# cool | |
def swtich(case): | |
return {1: 'one', 2: 'two', 3: 'three'}[case] | |
# not so cool | |
def switch(case): | |
if case == 1: | |
return 'one' | |
elif case == 2: | |
return 'two' | |
elif case == 3: | |
return 'three' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment