Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from operator import itemgetter
- month = input()
- hours = int(input())
- people = int(input())
- day_time = input()
- spring = ['march', 'april', 'may']
- summer = ['june', 'july', 'august']
- price = {'day': [10.50, 12.60], 'night': [8.40, 10.20]}
- price_per_hour = 0
- if month in spring:
- price_per_hour = itemgetter(day_time)(price)[0]
- elif month in summer:
- price_per_hour = itemgetter(day_time)(price)[1]
- if people >= 4:
- price_per_hour *= 0.90
- if hours >= 5:
- price_per_hour *= 0.50
- total = hours * price_per_hour * people
- print(f'Price per person for one hour: {price_per_hour:.2f}')
- print(f'Total cost of the visit: {total:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement