Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chrysanthemums = int(input())
- roses = int(input())
- tulips = int(input())
- season = input()
- holiday = input()
- price = 0
- if season == 'Spring' or season == 'Summer':
- price = 2 * chrysanthemums + 4.1 * roses + 2.5 * tulips
- elif season == 'Autumn' or season == 'Winter':
- price = 3.75 * chrysanthemums + 4.5 * roses + 4.15 * tulips
- if holiday == 'Y':
- price *= 1.15
- if tulips > 7 and season == 'Spring':
- price *= 0.95
- if roses >= 10 and season == 'Winter':
- price *= 0.9
- if chrysanthemums + roses + tulips > 20:
- price *= 0.8
- print(f'{(price + 2):.2f}')
- Фундаменталс решение:
- flower_count = {'chrysanthemums': int(input()), 'roses': int(input()), 'tulips': int(input())}
- season = input()
- holiday = input()
- price = {}
- if season == 'Spring' or season == 'Summer':
- price = {'chrysanthemums': 2.00, 'roses': 4.10, 'tulips': 2.50}
- elif season == 'Autumn' or season == 'Winter':
- price = {'chrysanthemums': 3.75, 'roses': 4.50, 'tulips': 4.15}
- total = flower_count['chrysanthemums'] * price['chrysanthemums'] \
- + flower_count['roses'] * price['roses'] + flower_count['tulips'] * price['tulips']
- if holiday == 'Y':
- total *= 1.15
- if flower_count['tulips'] > 7 and season == 'Spring':
- total *= 0.95
- if flower_count['roses'] >= 10 and season == 'Winter':
- total *= 0.9
- if sum(flower_count.values()) > 20:
- total *= 0.8
- print(f'{(total + 2):.2f}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement