I have a long list of functions that needs to be executed based on user input
I want a way to do this without a long if else statement
Thanks in advance this will save a lot of time
def function1(a,b):
return a+b
def function2(a,b):
return a-b
.
.
.
there a are many functions like this
.
.
.
class marks:
def __init__(self,w,b):
self.w=w
self.b=b
def execute(self,function):
I WANT TO KNOW THIS PART
m=marks(50,30)
m.execute("function2") should perform function2 and print
m.execute("function45") should perform function45 and print