For the first input of my program,Brand,the program does not ask the user to re-enter the input when the input is wrong,it just moves on to the next input. For the rest of the input the program runs as intended.
I've tried to search online but still could not find a solution to solve the problem.
exit=input('Press any button to continue,press Q or q to exit')
if exit=='q' or exit=='Q':
break
else:
Brand = input("Enter the perfume brand: ")
while True:
try:
while True:
Scent = input("What type of scents you looking for (Floral/Woody/Oriental): ").lower()
if Scent == 'floral'or Scent == 'woody' or Scent == "oriental":
break
else:
print('Invalid perfume scent')
continue
while True:
Type = input("What type of perfume you like it in (Eau De Parum/Eau De Toilette/Eau De Cologne): ").lower()
if Type == 'eau de parum':
break
else:
print('Invalid type of perfume')
continue
Quantity = int(input("Enter quantity of the perfume :"))
price = float(input("Enter price of the perfume:$ "))
print("Brand:",Brand)
print("Scents:",Scent)
print("Type:",Type)
print("Quantity:",Quantity)
print("price:$",format(price,'.2f'))
except:
print('Invalid perfume')
The expected result of the program is to check at every input if the right input is entered otherwise the user have to re-enter the input until it is the correct one.
Sorry if I could not clearly explain what my program wants to achieve