anton_d

03. Flowers

Jan 19th, 2022 (edited)
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. chrysanthemums = int(input())
  2. roses = int(input())
  3. tulips = int(input())
  4. season = str(input()).lower()
  5. holiday = input().lower()
  6.  
  7. bouquet = chrysanthemums + roses + tulips  # брой цветя
  8. flowers_price = 0 #  цена на букетът
  9.  
  10. if season == 'spring' or season == 'summer':
  11.     flowers_price += chrysanthemums * 2.00
  12.     flowers_price += roses * 4.10
  13.     flowers_price += tulips * 2.50
  14. elif season == 'autumn' or season == 'winter':
  15.     flowers_price += chrysanthemums * 3.75
  16.     flowers_price += roses * 4.50
  17.     flowers_price += tulips * 4.15
  18.  
  19. if holiday == 'y':
  20.     flowers_price *= 1.15
  21. if tulips > 7 and season == 'spring':
  22.     flowers_price *= 0.95
  23. if roses >= 10 and season == 'winter':
  24.     flowers_price *= 0.90
  25. if bouquet > 20:
  26.     flowers_price *= 0.80
  27.  
  28. print('%.2f' % (flowers_price + 2))
  29.  
Add Comment
Please, Sign In to add comment