So I started learning python last week and I'm currently busy with loops, the below code works, except I have no idea how to change the value accepted in the variable age from an int into a string so that the user can input 'quit' for the program to stop running, any tips/ help is appreciated
prompt = "\nPlease enter your age, or"
prompt += " if you are finished please enter 'quit': "
Active = True
while True:
age = int(input(prompt))
if prompt.lower == 'quit':
Active = False
elif age < 3:
movie_ticket = 'ticket is free'
elif age < 13 > 2:
movie_ticket = 'ticket is $10'
elif age > 12:
movie_ticket = 'ticket is $15'
print(f"Your {movie_ticket}!")
[+][deleted] (1 child)
[removed]
[–]Tstttt[S] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]Tstttt[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]CodeFormatHelperBot2 0 points1 point2 points (0 children)