I have a bunch of functions in Python out1, out2, out3 etc. and would like to call them based on an integer I pass in.
def arryofPointersToFns (value):
One can access methods through a dictionary:
def one1():
print("Method one1 called")
def one2():
print("Method one2 called")
def one3():
print("Method one3 called")
methodDictionary = {1: one1, 2:one2, 3: one3}
method1 = methodDictionary[1]
method1()
method2 = methodDictionary[2]
method2()
method3 = methodDictionary[3]
method3()