Petar_Matev

Flowers

Jan 29th, 2021
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.94 KB | None | 0 0
  1. # 3. Магазин за цветя
  2. n_chrysanthemums = int(input())
  3. n_roses = int(input())
  4. n_tulips = int(input())
  5. season = str(input())
  6. holiday = str(input())
  7.  
  8. chrysanthemums_price = 0
  9. roses_price = 0
  10. tulips_price = 0
  11. arranging = 2
  12. total = n_chrysanthemums + n_roses + n_tulips
  13.  
  14. if season == "Spring" or season == "Summer":
  15.     chrysanthemums_price = 2
  16.     roses_price = 4.10
  17.     tulips_price = 2.50
  18. elif season == "Autumn" or season == "Winter":
  19.     chrysanthemums_price = 3.75
  20.     roses_price = 4.50
  21.     tulips_price = 4.15
  22.  
  23. if holiday == "Y":
  24.     chrysanthemums_price *= 1.15
  25.     roses_price *= 1.15
  26.     tulips_price *= 1.15
  27.  
  28. bouquet = (n_chrysanthemums * chrysanthemums_price) + (n_roses * roses_price) + (n_tulips * tulips_price)
  29.  
  30. if n_tulips > 7 and season == "Spring":
  31.     bouquet *= 0.95
  32. if n_roses >= 10 and season == "Winter":
  33.     bouquet *= 0.9
  34. if total > 20:
  35.     bouquet *= 0.80
  36.  
  37. print(f"{bouquet + arranging:.2f}")
  38.  
Advertisement
Add Comment
Please, Sign In to add comment