Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 1. наем -> зависи от сезона
- # 2. отстъпки спрямо броя хора
- # 3. допълнителна отстъпка
- # 4. проверка за бюджета
- budget = int(input())
- season = input() # "Spring", "Summer", "Autumn" или "Winter";
- fishers_count = int(input())
- # наем
- rent = 0
- if season == 'Spring':
- rent = 3000
- elif season == 'Summer' or season == 'Autumn':
- rent = 4200
- elif season == 'Winter':
- rent = 2600
- # намаление
- if fishers_count <= 6:
- rent = rent - 0.10 * rent # 0.9 * rent
- elif 7 <= fishers_count <= 11:
- rent = rent - 0.15 * rent # 0.85 * rent
- else:
- rent = rent - 0.25 * rent # 0.75 * rent
- # допълнително намаление
- if fishers_count % 2 == 0 and not season == 'Autumn':
- rent = rent - 0.05 * rent # 0.95 * rent
- # проверка за бюджета
- if budget >= rent:
- left_money = budget - rent
- print(f'Yes! You have {left_money:.2f} leva left.')
- else:
- need_money = rent - budget
- print(f'Not enough money! You need {need_money:.2f} leva.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement