Hello, I'm a first time user of Python, but I have c++/VB.Net experience. I absolutely dread Python's syntax, but I need to learn it.
What is wrong with my implementation of this switch? Instead of only calling the function of the matching string, it calls all 3.
What is wrong with my implementation of this switch? Instead of only calling the function of the matching string, it calls all 3.
def f_3OAK(): print("Hello1.") return False def f_4OAK(): print("Hello2.") return False def f_5OAK(): print("Hello3.") return False def case(s_Input): #My definition of a Case Switch. return { '3OAK': f_3OAK(), '4OAK': f_4OAK(), '5OAK': f_5OAK() }[s_Input] while True: case(input("\nPlease enter the win you wish to search for: "))Thank you in advance.