I have a script which needs to iterate through thousands of various different, but simple options.
I can use if...elif to iterate through them, but am wondering if there is a faster / better option than thousands of elifs. For example
if something == 'a':
do_something_a
elif something == 'b':
do_something_b
elif something == 'c':
do_something_c
elif something == 'd':
do_something_d
...
A thousand more elifs
...
else:
do_something_else
The thing I will be doing will usually be running a function of some kind.