-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path9_Ski_trip.py
54 lines (40 loc) · 1.37 KB
/
9_Ski_trip.py
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# ▪ "room for one person" – 18.00 лв за нощувка
# ▪ "apartment" – 25.00 лв за нощувка
# ▪ "president apartment" – 35.00 лв за нощувка
#11 days= 10 nights
days = int(input())
stay_type = input() # "room for one person", "apartment", or "president apartment"
evaluation = input() # "positive" or "negative"
night = days - 1
night_price = 0.0
discount = 0.0
if stay_type == 'room for one person':
night_price = 18.00
if days < 10:
discount = 0.0
elif days <= 15: # [10, 15]
discount = 0.0
else: # (15, inf) == [16, inf)
discount = 0.0
elif stay_type == 'apartment':
night_price = 25.00
if days < 10:
discount = 0.30
elif days <= 15: # [10, 15]
discount = 0.35
else: # (15, inf) == [16, inf)
discount = 0.50
elif stay_type == 'president apartment':
night_price = 35.00
if days < 10:
discount = 0.10
elif days <= 15: # [10, 15]
discount = 0.15
else: # (15, inf) == [16, inf)
discount = 0.20
total_price = night * night_price * (1 - discount)
if evaluation == 'positive':
total_price *= 1.25 # total_price = total_price * (1 + 0.25)
elif evaluation == 'negative':
total_price *= 0.90 # total_price = total_price * (1 - 0.10)
print(f'{total_price :.2f}')