Python - replace long if/elif chain with dict mappings

Python - replace long if/elif chain with dict mappings