I have a Python program asking the user for input like a shell, and if I detect some specific keywords I want to go inside some specific functions.
The thing is that I would like to avoid doing a lot of if
and else if
. Usually in C to avoid this situation I use a function pointer array that I travel with a while
and use strcmp
to check the input.
I would like to know how to do that in Python if it is even possible.