Advertisement
horozov86

03. Flowers - PB-More-Exercises

Oct 1st, 2022
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.32 KB | None | 0 0
  1. count_chrysanthemums = int(input())
  2. count_roses = int(input())
  3. count_tulips = int(input())
  4. season = input()
  5. day_off = input()
  6.  
  7. price_bouquet = 0
  8.  
  9. if season == "Spring" or season == "Summer":
  10.     if day_off == "Y":
  11.         price_bouquet = (count_chrysanthemums * 2 + count_roses * 4.10 + count_tulips * 2.50) * 1.15
  12.     else:
  13.         price_bouquet = count_chrysanthemums * 2 + count_roses * 4.10 + count_tulips * 2.50
  14.     if count_tulips > 7 and season == "Spring":
  15.         price_bouquet = price_bouquet * 0.95
  16.     else:
  17.         price_bouquet = price_bouquet * 1
  18.  
  19. elif season == "Autumn" or season == "Winter":
  20.     price_bouquet = count_chrysanthemums * 3.75 + count_roses * 4.50 + count_tulips * 4.15
  21.     if day_off == "Y":
  22.         price_bouquet = price_bouquet * 1.15
  23.     else:
  24.         price_bouquet = count_chrysanthemums * 3.75 + count_roses * 4.50 + count_tulips * 4.15
  25.     if count_roses >= 10 and season == "Winter":
  26.         price_bouquet = price_bouquet * 0.90
  27.     else:
  28.         price_bouquet = count_chrysanthemums * 3.75 + count_roses * 4.50 + count_tulips * 4.15
  29.  
  30. count_flowers = count_chrysanthemums + count_roses + count_tulips
  31. if count_flowers > 20:
  32.     price_bouquet = price_bouquet * 0.80
  33. else:
  34.     price_bouquet = price_bouquet * 1
  35.  
  36. final_price = price_bouquet + 2
  37.  
  38. print(f"{final_price:.2f}")
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement