Advertisement
veronikaaa86

04. Toy Shop

Jul 9th, 2023
903
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 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. total_sum = (puzzle_count * 2.60) + (dolls_count * 3) + (teddy_count * 4.10) + (minions_count * 8.20) + (trucks_count * 2)
  9.  
  10. total_count = puzzle_count + dolls_count + teddy_count + minions_count + trucks_count
  11.  
  12. if total_count >= 50:
  13.     total_sum = total_sum - (total_sum * 0.25)
  14.  
  15. total_sum = total_sum - (total_sum * 0.1)
  16.  
  17. diff = abs(total_sum - trip_price)
  18. if total_sum >= trip_price:
  19.     print(f"Yes! {diff:.2f} lv left.")
  20. else:
  21.     print(f"Not enough money! {diff:.2f} lv needed.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement