Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- flower_type = input()
- count_flowers = int(input())
- budget = int(input())
- # 1. крайна цена = бр.цветя * ед.цена (зависи от типа)
- # 2. намаления
- total_price = 0
- if flower_type == 'Roses':
- total_price = count_flowers * 5
- if count_flowers > 80:
- total_price = total_price - 0.10 * total_price #0.9 * totalPrice
- elif flower_type == 'Dahlias':
- total_price = count_flowers * 3.80
- if count_flowers > 90:
- total_price = total_price - 0.15 * total_price #0.85 * totalPrice
- elif flower_type == 'Tulips':
- total_price = count_flowers * 2.80
- if count_flowers > 80:
- total_price = total_price - 0.15 * total_price # 0.85 * totalPrice
- elif flower_type == 'Narcissus':
- total_price = count_flowers * 3
- if count_flowers < 120:
- total_price = total_price + 0.15 * total_price # 1.15 * totalPrice
- elif flower_type == 'Gladiolus':
- total_price = count_flowers * 2.50
- if count_flowers < 80:
- total_price = total_price + 0.20 * total_price # 1.20 * totalPrice
- # 3. проверка дали им стига бюджета
- if budget >= total_price:
- left = budget - total_price
- print(f'Hey, you have a great garden with {count_flowers} {flower_type} and {left:.2f} leva left.')
- else:
- need = total_price - budget
- print(f'Not enough money, you need {need:.2f} leva more.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement