Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. trip_price = float(input())
  2. puzzle_count = int(input())
  3. toy_count = int(input())
  4. bear_count = int(input())
  5. minions_count = int(input())
  6. truck_count = int(input())
  7.  
  8. puzzle = 2.60
  9. toy = 3
  10. bear = 4.10
  11. minion = 8.20
  12. truck = 2
  13.  
  14. toys_count = puzzle_count + toy_count + bear_count + minions_count + truck_count
  15. result = puzzle * puzzle_count + toy * toy_count + \
  16.          bear * bear_count + minions_count * minion + truck_count * truck
  17.  
  18. if toys_count >= 50:
  19.     result -= result * 0.25
  20.  
  21. result -= result * 0.10
  22.  
  23. if result >= trip_price:
  24.     resolt = abs(trip_price - result)
  25.     print(f"Yes! {resolt:.2f} lv left.")
  26. else:
  27.     resolt = abs(trip_price - result)
  28.     print(f"Not enough money! {resolt:.2f} lv needed.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement