Advertisement
veronikaaa86

04. Toy Shop

Mar 6th, 2022
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. trip_price = float(input())
  2. puzzle_count = int(input())
  3. dolls_count = int(input())
  4. teddy_count = int(input())
  5. minions_count = int(input())
  6. trucks_count = int(input())
  7.  
  8. puzzle_price = puzzle_count * 2.60
  9. dolls_price = dolls_count * 3
  10. teddy_price = teddy_count * 4.10
  11. minions_price = minions_count * 8.20
  12. trucks_price = trucks_count * 2
  13.  
  14. total_price = puzzle_price + dolls_price + teddy_price + minions_price + trucks_price
  15.  
  16. total_count = puzzle_count + dolls_count + teddy_count + minions_count + trucks_count
  17.  
  18. if total_count >= 50:
  19. total_price = total_price * 0.75
  20.  
  21. total_price = total_price * 0.90
  22.  
  23. diff = abs(trip_price - total_price)
  24. if trip_price <= total_price:
  25. print(f"Yes! {diff:.2f} lv left.")
  26. else:
  27. print(f"Not enough money! {diff:.2f} lv needed.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement