Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- month = str(input().lower()).strip()
- nights = int(input())
- studio = {
- "may": 50,
- "october": 50,
- "june": 75.20,
- "september": 75.20,
- "july": 76,
- "august": 76
- }
- apartment = {
- "may": 65,
- "october": 65,
- "june": 68.70,
- "september": 68.70,
- "july": 77,
- "august": 77
- }
- cost_studio = float(studio.get(month, "") * nights)
- cost_apart = float(apartment.get(month, "") * nights)
- if (nights in range(8, 15)) and (month in ("may october")):
- discount = 0.95
- cost_studio *= discount
- elif (nights > 14) and (month in ("may october")):
- discount = 0.70
- cost_studio *= discount
- elif (nights > 14) and (month in ("june september")):
- discount = 0.80
- cost_studio *= discount
- if nights > 14:
- cost_apart *= 0.9
- print(f"Apartment: {cost_apart:.2f} lv.")
- print(f"Studio: {cost_studio:.2f} lv.")
Advertisement
Add Comment
Please, Sign In to add comment