Created
February 12, 2014 01:24
-
-
Save waynew/8948170 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
from __future__ import print_function | |
switch = {"case 1": lambda: print("Hey, case 1"), | |
42: lambda: print("The answer to life, the universe, and everything"), | |
"spam": lambda: print("A favourite metasyntactic variable of Pythonistas everywhere"), | |
"fnord": lambda: print("You can't see the fnords."), | |
} | |
val = "spam" | |
switch[val]() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment