I understand we can use dictionary mapping with functions like this:
def call_functions(input)
def function1():
print "called function 1"
def function2():
print "called function 2"
def function3():
print "called function 3"
tokenDict = {"cat":function1,
"dog":function2,
"bear":function3}
return tokenDict[input]()
But what if we want to set two functions as a value in the dictionary? Like:
tokenDict = {"cat":function1, function2
"dog":function2
....
I tried using a list like "cat":[function1, function2] but is there an easier way to do it?
When I call it, I want it to execute function1 and then function2
"cat": lambda: function1(), function2().