I'm designing a code that recreates the same logic as a flowchart. I've made a function that allows you to interact with the questions and it works fine, until you input something other than 'yes' or 'no'. I want to create a function that, for every input answer, if it is different than yes and no, it should say to input it again, and then keep going from where it left off.
So I tried
def error(x):
while True:
if x.lower() != "yes" or x.lower() != "no":
tryagain = input("Please only enter 'yes' or 'no'\n")
return (error(tryagain))
continue
But after asking me to input the answer again, even if I type yes or no, it just keeps on repeating "Please only enter 'yes' or 'no'". I've also tried other codes (for loops, ifs and elifs, while loops worded differently) but they don't work. I'm currently working without packages, as I'm still learning the basics.
Please help