This is actually (almost) exactly how I would handle it in Python. Why? Well switch statements don't actually exist in Python anyway, so to get the same efficiency you use a dictionary (map) lookup.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is actually (almost) exactly how I would handle it in Python. Why? Well switch statements don't actually exist in Python anyway, so to get the same efficiency you use a dictionary (map) lookup.