I have created a very basic function that will return "Yes1" when the user says "Yes" and "No1" when the user says "No", I also have a line that makes the function reset itself when the user enters an unrecognized answer. This function works fine except when I enter multiple invalid answers, at which poitn it only responds "No1", even if I put "Yes". The code is here:
print ("Welcome to the automated phone trouble shooting service, please answer with either 'Yes' or 'No'")
print("unless the questions asks otherwise")
print ("Welcome to the automated phone trouble shooting service, please answer with either 'Yes' or 'No'")
print("unless the questions asks otherwise")
def q1():
answer1=input("Is the phone wet?")
if answer1== "Yes":
return True
elif answer1== "No":
return False
else:
print("Invalid answer, restarting now")
q1()
if q1()==True:
print ("Yes1")
else:
print ("No1")