Write the program in python language
Scenario is
A fair has come to the city and the price of the entry tickets are as below:
AGE TICKET PRICE
Below 6 years Rs 20/-
6 to 9 years Rs 30/-
10 to 17 years Rs 50/-
18 years and above Rs 100/
They are giving a discount of 5% on their ticket price as part of their anniversary.
(So, discount amount= 0.05*ticket price)
Write a program to:
● Accept the age of the customer and calculate the total amount of the ticket after discount.
● Finally display the age and total amount calculated after discount with appropriate message.
age = int(input('Please enter your age: '))
if age < 6:
print(f'Your age {age}, to pay {20 * 0.95} Rs')
elif 6 <= age <= 9:
print(f'Your age {age}, to pay {30 * 0.95} Rs')
elif 10 <= age <= 17:
print(f'Your age {age}, to pay {50 * 0.95} Rs')
elif age >= 18:
print(f'Your age {age}, to pay {100 * 0.95} Rs')
Comments
Leave a comment