George_Ivanov05

07. Flower Shop

Feb 17th, 2021
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. import math
  2.  
  3. magnolias = int(input())
  4. hyacinths = int(input())
  5. roses = int(input())
  6. cacti = int(input())
  7. price_gift = float(input())
  8.  
  9. price_magnolias = magnolias * 3.25
  10. price_hyacinths = hyacinths * 4
  11. price_roses = roses * 3.50
  12. price_cacti = cacti * 8
  13.  
  14. sum = price_cacti + price_roses + price_hyacinths + price_magnolias
  15.  
  16. taxes = sum * 0.05
  17.  
  18. total_sum_left = sum - taxes
  19.  
  20. if total_sum_left  >= price_gift:
  21.     money_left = total_sum_left - price_gift
  22.     print(f"She is left with {math.ceil(money_left)} leva")
  23. elif total_sum_left < price_gift:
  24.     money_needed = price_gift - total_sum_left
  25.     print(f"She will have to borrow {math.ceil(money_needed)} leva.")
Advertisement
Add Comment
Please, Sign In to add comment