Denis2312

Toy Shop

Mar 19th, 2024 (edited)
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. price_of_trip = float(input())
  2.  
  3. number_of_puzzles = int(input())
  4. number_of_dolls = int(input())
  5. number_of_bears = int(input())
  6. number_of_minions = int(input())
  7. number_of_trucks = int(input())
  8.  
  9. amount_puzzle = number_of_puzzles * 2.60
  10. amount_dolls = number_of_dolls * 3
  11. amount_bears = number_of_bears * 4.10
  12. amount_minions = number_of_minions * 8.20
  13. amount_trucks = number_of_trucks * 2
  14.  
  15. toys_count = (amount_puzzle + amount_dolls + amount_bears + amount_minions + amount_trucks)
  16.  
  17. total_sum = (number_of_puzzles + number_of_dolls + number_of_bears + number_of_minions + number_of_trucks)
  18.  
  19. if toys_count >= 50:
  20.     total_sum *= 0.25
  21.  
  22. total_sum = toys_count * 0.9
  23.  
  24. if total_sum >= price_of_trip:
  25.     print(f"Yes! {total_sum - price_of_trip:.2f} lv left.")
  26. else:
  27.     (f"Not enough money! {price_of_trip - total_sum:.2f} lv needed.")
Advertisement
Add Comment
Please, Sign In to add comment