Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- season = input()
- group = input()
- people = int(input())
- nights = int(input())
- price = 0
- sport = ''
- if season == 'Winter':
- if group == 'boys':
- price = 9.6
- sport = 'Judo'
- elif group == 'girls':
- price = 9.6
- sport = 'Gymnastics'
- else:
- price = 10
- sport = 'Ski'
- elif season == 'Spring':
- if group == 'boys':
- price = 7.2
- sport = 'Tennis'
- elif group == 'girls':
- price = 7.2
- sport = 'Athletics'
- else:
- price = 9.5
- sport = 'Cycling'
- else:
- if group == 'boys':
- price = 15
- sport = 'Football'
- elif group == 'girls':
- price = 15
- sport = 'Volleyball'
- else:
- price = 20
- sport = 'Swimming'
- if 10 <= people < 20:
- price *= 0.95
- elif 20 <= people < 50:
- price *= 0.85
- elif people >= 50:
- price /= 2
- total = price * people * nights
- print(f'{sport} {total:.2f} lv.')
- Решение с колекция:
- season = input()
- group = input()
- people = int(input())
- nights = int(input())
- price = {
- 'Winter': {'boys': 9.60, 'girls': 9.60, 'mixed': 10.00},
- 'Spring': {'boys': 7.20, 'girls': 7.20, 'mixed': 9.50},
- 'Summer': {'boys': 15.00, 'girls': 15.00, 'mixed': 20.00}
- }
- sports = {
- "Winter": {'boys': 'Judo', 'girls': 'Gymnastics', 'mixed': 'Ski'},
- "Spring": {'boys': 'Tennis', 'girls': 'Athletics', 'mixed': 'Cycling'},
- "Summer": {'boys': 'Football', 'girls': 'Volleyball', 'mixed': 'Swimming'}
- }
- total = (price[season][group] * people * nights *
- {people > 0: 1, people >= 10: 0.95, people >= 20: 0.85, people >= 50: 0.50}[True])
- print(f'{sports[season][group]} {total:.2f} lv.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement