Today is my second day of coding, can anyone help me with this?
I'm writing a code to prompt user to answer yes, YES, y, Y or no, NO, n, N. If the user answer with another answer, the system should prompt user to answer again. Below is the current code I wrote.
However, I can't do it, can anyone help? Should I use what kind of loop?
print("Please answer the question below in y or n!!")
answer1 = input("Do you want apple?")
answer_yes = "y"
answer_no = "n"
if answer1 == answer_yes:
print("Here you go!")
elif answer1 == answer_no:
print("There are apples for you in the fridge!")
else:
print(input("Do you want apple?"))