Professional Documents
Culture Documents
Bala Baran
Bala Baran
total_cost = 0
ages = []
while True:
age_input = input("Enter the age of guest(or press to finish) ")
if not age_input:
break
try:
age = int(age_input)
ages.append(age)
except ValueError:
print("Invalid Input. Please enter a valid age")
#Ticket Price Calculation
if age <=2:
cost = 0
elif 3 <= age <= 10:
cost = 140
elif age >= 65:
cost = 200
else:
cost = 300
total_cost += cost