Advertisement
Nikolay_Kashev

toyShop.py

Apr 21st, 2024
589
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.85 KB | Source Code | 0 0
  1. puzzle = 2.60
  2. talking_doll = 3
  3. teddy_bear = 4.10
  4. minion = 8.20
  5. truck = 2
  6.  
  7. vacation_price = float(input())
  8. puzzle_quantity = int(input())
  9. talking_doll_quantity = int(input())
  10. teddy_bear_quantity = int(input())
  11. minion_quantity = int(input())
  12. truck_quantity = int(input())
  13.  
  14. toys_quantity = puzzle_quantity + talking_doll_quantity + teddy_bear_quantity + minion_quantity + truck_quantity
  15.  
  16. total_price = (
  17.     puzzle * puzzle_quantity +
  18.     talking_doll * talking_doll_quantity +
  19.     teddy_bear * teddy_bear_quantity +
  20.     minion * minion_quantity +
  21.     truck * truck_quantity
  22. )
  23.  
  24. if toys_quantity >= 50:
  25.     total_price *= 0.75
  26.  
  27. total_price -= total_price * 0.10
  28.  
  29. if total_price >= vacation_price:
  30.     print(f"Yes! {total_price - vacation_price:.2f} lv left.")
  31. else:
  32.     print(f"Not enough money! {vacation_price - total_price:.2f} lv needed.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement