Skip to content

Instantly share code, notes, and snippets.

@kirkegaard kirkegaard/switch.py
Last active Aug 29, 2017

Embed
What would you like to do?
from random import randint
def s(x):
return {
0: 'foo',
1: 'bar',
2: 'flaf',
3: 'giraf'
}.get(x, 'none')
res = s(randint(0, 10))
print(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.