Switch Statements in Python
Replace with
maps-as-switch.py
response, data = somefunc()
if response == "this":
do_this_with(data)
elif response == "that":
do_that_with(data)
elif response == "huh":
duh(data)
# lots more elifs.
else:
prevent_horrible_crash(data)
Replace with
maps-as-switch.py
|