rafaelmaeuer
12/5/2019 - 6:51 PM

Replacements for switch statement in Python?

def f(x):
    return {
        'a': 1,
        'b': 2,
    }[x]