-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestion9.py
More file actions
38 lines (31 loc) · 977 Bytes
/
question9.py
File metadata and controls
38 lines (31 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def question9():
age= int(input("Enter age:"))
day = input("Enter day of week:").lower()
tickets = int(input("Enter number of tickets:"))
#Age-based pricing
if age < 3:
base_price = 0
category = "Free"
elif age <= 12:
base_price = 150
category = "Child"
elif age <= 59:
base_price = 300
category = "Adult"
else:
base_price = 200
category = "Senior"
total_base = base_price * tickets
#Day-based discount
if day in ["friday", "saturday", "sunday"]:
discount = 0.10 * total_base *0.20
else:
discount = 0
final_amount = total_base - discount
print("\n=== TICKET BILL ===")
print("Category:", category)
print("Base price per ticket: ₹", base_price)
print("Total base amount: ₹", total_base)
print("Discount: ₹", discount)
print("Final amount: ₹", final_amount)
question9()