r/learnpython • u/Last-Agency-9818 • 6h ago
Anyone help me with this loop? I cant break out of the outer loop?
while True:
try:
STickets = float(input("Please enter the amount of student tickets you would like"))
if STickets %1 !=0:
print("please enter a whole number!")
continue
elif STickets < 0:
print("please enter a positive number!")
continue
else:
print(f"You have selected {int(STickets)}")
Answer = input("is this the correct number? Yes/No").strip().capitalize()
while True:
if Answer == "No":
break
if Answer =="Yes":
print("Confirmed")
break
else:
Answer = input("Enter Yes or No: ").strip().capitalize()
if Answer == "Yes":
break