Apr-09-2018, 11:12 AM
(Apr-09-2018, 09:21 AM)IAMK Wrote: However, do you know why my code was printing all 3?Function calls in return dictionary will trigger all call.
Could do it like this.
def f_3OAK(): print("Hello1.") def f_4OAK(): print("Hello2.") def f_5OAK(): print("Hello3.") def case(s_Input): 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: "))()