I'm writing a python function that calls a function based on a parameter it takes. It looks something like this:
def match(parameter):
if parameter == 'fun1':
fun1()
elif parameter == 'fun2':
fun2()
elif parameter == 'fun3':
fun3()
All those functions being called are then defined below the match function. Is there a more efficient way to organize the match function? I can't find anything about pattern matching with functions, but could a data structure of some sort work?
Thanks for the help.