The article talks about string keys, but Python allows many things to be used as keys. For example, instead of chains of `elif` we can look up `True` in a dictionary:
>>> age = 25
>>> {
... (age < 18): "Forbidden",
... (age == 18): "OK, you're old enough now",
... (age > 18 and age < 20): "LOL teen emoji amirite?",
... (age >= 20 and age < 40): "Hi",
... (age >= 40): "Welcome",
... }[True]
'Hi'
One thing that's annoying with this pattern is that Python calculates values eagerly, so we can't use it for expensive calculations or observable effects. To make the values lazy we can wrap them in `lambda:`, but at that point we're essentially re-implementing dynamic dispatch, so classes may be better (or a couple of `elif`s, at most). Note: that's what the article's doing ;)