Im trying to implement a menu in my tool. But i couldn't implement a switch case in python. i know that python has only dictionary mapping. How to call parameterised methods in those switch case? For example, I have this program
def Choice(i):
switcher = {
1: subdomain(host),
2: reverseLookup(host),
3: lambda: 'two'
}
func = switcher.get(i, lambda:'Invalid')
print(func())
Here, I couldn't perform the parameterised call subdomain(host)
. Please help.