Advertisement
Guest User

Flowers

a guest
Apr 9th, 2020
627
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.99 KB | None | 0 0
  1. bought_lillias = int(input())
  2. bought_roses = int(input())
  3. bought_tulips = int(input())
  4. season = input()
  5. isHoliday = input()
  6.  
  7. lillia_price = 0.0
  8. roses_price = 0.0
  9. tulips_price = 0.0
  10. discount = 0.00
  11. buquet_price = 0.0
  12. total_flowers = 0
  13. total_price = 0.0
  14.  
  15. if season == "Spring" or season == "Summer":
  16.     lillia_price = 2.00
  17.     roses_price = 4.10
  18.     tulips_price = 2.5
  19. else:
  20.     lillia_price = 3.75
  21.     roses_price = 4.5
  22.     tulips_price = 4.15
  23.  
  24. buquet_price = lillia_price * bought_lillias + roses_price * bought_roses + tulips_price * bought_tulips
  25.  
  26. if isHoliday == "Y":
  27.     buquet_price += buquet_price * 0.15
  28.  
  29. total_flowers_bought = bought_roses + bought_tulips + bought_lillias
  30.  
  31. if bought_tulips >= 7 and season == "Spring":
  32.     discount = 0.05 * buquet_price
  33. if bought_roses >= 10 and season == "Winter":
  34.     discount = 0.1 * buquet_price
  35. if total_flowers_bought >= 20:
  36.     discount = 0.2 * buquet_price
  37.  
  38. total_price = buquet_price + 2 - discount
  39. print(f"{total_price:0.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement