Friday, July 2, 2021

Too Many If-Elif Conditions in Python? Use Dictionaries Instead

 https://betterprogramming.pub/too-many-if-elif-conditions-in-python-use-dictionaries-instead-5486299af27e

I've blundered into this technique myself to make up for the lack of case statement. Their implementation is a bit cleaner than mine.