SyntaxFix
Write A Post
Hire A Developer
Questions
You can just use
myDict = { "P1": (lambda x: function1()), "P2": (lambda x: function2()), ..., "Pn": (lambda x: functionn())} myItems = ["P1", "P2", ..., "Pn"] for item in myItems: myDict[item]()