Advertisement
veronikaaa86

04. Toy Shop

Sep 18th, 2022
1,213
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 1 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.6) + (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(trip_price - total_sum)
  18. if trip_price <= total_sum:
  19.     print(f"Yes! {diff:.2f} lv left.")
  20. else:
  21.     print(f"Not enough money! {diff:.2f} lv needed.")
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement