Implement C's Switch in Python 3

Skip Montanaro skip.montanaro at gmail.com
Sat Feb 2 20:12:56 EST 2019


>
> I have an unhashable type list.
>

Try replacing the list with a tuple. Also, read up on immutable v mutable
types and dictionary keys for a bit of background on why a list won't work.

Skip

>



More information about the Python-list mailing list