just started to mess with python and I'm looking for an alternative for Switch-Case
like i had in C#
I have a Menu with 3 options for example. this is the switcher i have right now:
def mySC(i):
switcher = {
'1': funcName1,
'2': funcName2,
'3': funcName3
}
func = switcher.get(i, lambda: 'Invalid')
return func()
it works and I'm able to enter the function i want.
my problem is what if i want to send different arguments to each function?
for ex. if someone entered 1
i want it to enter funcName1()
but also send a var into it like funcName1(nums)
and for 2
i want to send funcName1(myTwoDimList)
how will i be able to do that?
thanks in advance, Amit.