0
0 Комментариев

[apcode language=»python»]# Reguest age
prompt = "Enter your age to calculate ticket price"
prompt += "Enter 'quit'to complete the survey: "
active = True
while active:
age = input(prompt)
print( age )
if age == 'quit':
active = False
else:
age = int(age)
if (age <= 3):
print("\nTicket free\n")
elif (age > 3) and (age <= 12):
print("\the ticket coasts 10$\n")
elif (age >= 12):
print("\tthe ticket coasts 15$\n")
[/apcode]


Добавить комментарий