BbJLeB

03. Flowers

May 12th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.09 KB | None | 0 0
  1. # 03. Flowers
  2.  
  3. chrysanthemums = int(input()) # 2.00 3.75
  4. roses = int(input())          # 4.10 4.50
  5. tulips = int(input())         # 2.50 4.15
  6. season = input() # [Spring, Summer, Аutumn, Winter
  7. holiday = input()
  8. chrysanthemums_price = 0
  9. roses_price = 0
  10. tulips_price = 0
  11. flowers = chrysanthemums + roses + tulips
  12. price = 0
  13. if season == "Spring" or season == "Summer":
  14.     chrysanthemums_price = 2.00
  15.     roses_price = 4.10
  16.     tulips_price = 2.50
  17.     price = (chrysanthemums_price * chrysanthemums) + (roses_price * roses) + (tulips_price * tulips)
  18.     if holiday == "Y":
  19.         price = price + (price * 0.15)
  20.         if season == "Spring" and tulips >= 7:
  21.             price = price - (price * 0.05)
  22.             if flowers >= 20:
  23.                 price = price - (price * 0.20)
  24.         elif season == "Summer":
  25.             if flowers >= 20:
  26.                 price = price - (price * 0.20)
  27.     elif holiday == "N":
  28.         if season == "Spring" and tulips >= 7:
  29.             price = price - (price * 0.05)
  30.             if flowers >= 20:
  31.                 price = price - (price * 0.20)
  32.         elif season == "Summer":
  33.             if flowers >= 20:
  34.                 price = price - (price * 0.20)
  35. elif season == "Autumn" or season == "Winter":
  36.     chrysanthemums_price = 3.75
  37.     roses_price = 4.50
  38.     tulips_price = 4.15
  39.     price = (chrysanthemums_price * chrysanthemums) + (roses_price * roses) + (tulips_price * tulips)
  40.     if holiday == "Y":
  41.         price = price + (price * 0.15)
  42.         if season == "Winter" and roses >= 10:
  43.             price = price - (price * 0.10)
  44.             if flowers >= 20:
  45.                 price = price - (price * 0.20)
  46.         elif season == "Autumn":
  47.             if flowers >= 20:
  48.                 price = price - (price * 0.20)
  49.     elif holiday == "N":
  50.         if season == "Winter" and roses >= 10:
  51.             price = price - (price * 0.10)
  52.             if flowers >= 20:
  53.                 price = price - (price * 0.20)
  54.         elif season == "Autumn":
  55.             if flowers >= 20:
  56.                 price = price - (price * 0.20)
  57. print(f"{price + 2:.2f}")
Add Comment
Please, Sign In to add comment