Answer to Question #159881 in Python for Angela K

Question #159881

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.


1
Expert's answer
2021-01-29T17:00:47-0500
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')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS