I'm currently writing a program for a school project.
The purpose is for it to work as an online cash register.
answer = "a"
qty1 = 0
while True:
answer = str(input("\nDo you really wish to buy this? (Y/N) "))
if answer == "Y" or "y":
qty1 = int(input("\nHow much quantity of this item would you like to buy? "))
print("\nDo you really wish to buy", qty1, "pieces? (Y/N) ")
answer = str(input(""))
if answer == "Y" or "y":
print("Confirming order and returning to menu.")
break
else:
qty1=0
print("Cancelling order and returning to menu")
break
elif answer == "N" or "n":
print("Okay, returning to menu.")
break
else:
print("not valid answer")
Here is the code for the part of the program I'm having trouble with.
Whenever I reach this part of the program, the input seems to ignore whatever I put and it always goes through the if path.
Does anyone know why this is?
I'm new to programming, so sorry if this is just an easy fix.