Oct-05-2020, 08:36 PM
I am learning while loop. Below code is going into infinite loop when displaying the output. Please help.
prompt = input("Please share your age. I will tell you the price: ") age = int(prompt) while age == int(prompt): if age < 3: print("You are free to go!") elif age <=12: print("You have to pay $10.") else: print("You have to pay $15.")