Feb-08-2020, 07:35 PM
(This post was last modified: Feb-08-2020, 07:35 PM by fatherted99.)
discount = "You are aged between 13 and 15", ("Discount - 30%"), "You are aged between 16 and 17", ( "Discount - 20%"), "You are aged 50 and over ", ("Discount - 40%") age13_15, discount30, age16_17, discount20, age_50, discount40 = discount menu = "" exit_while = "" while exit_while != "exit": age = int(input("How old are you: ")) name = input("What is your name: ") exit_while = "" if age < 13: print("You are too young to purchase products/licenses to have accesss to the swimming centre. Please try again in {} years".format(13 - age)) elif 13 <= age <= 15: print("Hi") print("{0} \t {1}".format(age13_15, discount30)) elif 16 <= age <= 17: print("Hi") print("{0} \t {1}".format(age16_17, discount20)) elif age >= 50: print("Hi") print("{0} \t {1}".format(age_50, discount40)) else: print("You are aged over 17 and under 50 years old. Please try again in {} years".format( 50 - age)) while exit_while != "exit" or "again": menu = input("Do you want to try the program again; Enter \"quit\" to exit, or enter \"again\" to try the program again.") menu = menu.upper() if menu == "QUIT": print("Entry entered") exit_while = "exit" elif menu == "AGAIN": print("Entry entered") exit_while = "again" else: print("invalid entry")Sorry about my indentation. Here is the indented code.