hello i am trying to call a function or functions based on the user input. here is what i have written so far.
a = 0
b = 1
c = 2
def keyword(a):
print("what is the boss")
def keyword(b):
print("who is the boss")
def keyword(c):
print("where is the boss")
key_words=["what","who","where","when","why"]
x= input("ask.. ").split()
for a in x:
if str(a) in key_words:
keyword(key_words.index(a))
that is my code i am stuck please help. the problem is that it is not selecting the correct function
keywordat the top? When the program executes, only the last one of those can get used. Each time you set up a new function with the same name, it overwrites any previous function by that name.