Sichanov

eee

Jan 16th, 2021
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.94 KB | None | 0 0
  1. puzzle_price = 2.60
  2. talking_barbie = 3
  3. teddy_bear = 4.10
  4. minion = 8.20
  5. truck_toy = 2
  6.  
  7. trip_price = float(input())
  8. a = num_of_puzzles = int(input())
  9. b = num_of_talking_barbie = int(input())
  10. c = num_of_teddy_bears = int(input())
  11. d = num_of_minions = int(input())
  12. e = num_of_toy_trucks = int(input())
  13.  
  14. price = a * puzzle_price + b * talking_barbie + c * teddy_bear + d * minion + e * truck_toy
  15. num_toys = num_of_puzzles + num_of_talking_barbie + num_of_teddy_bears + num_of_minions + num_of_toy_trucks
  16.  
  17. if num_toys >= 50:
  18.     discount = price * 25 / 100
  19.     total = price - discount
  20.     rent = total * 10 / 100
  21.     profit = total - rent
  22. else:
  23.     discount = 0
  24.     rent = price * 10 / 100
  25.     profit = price - rent
  26.    
  27. if profit >= trip_price:
  28.     left_money = profit - trip_price
  29.     print(f"Yes! {left_money:.2f} lv left.")
  30. else:
  31.     needed_money = trip_price - profit
  32.     print(f"Not enough money! {needed_money:.2f} lv needed.")
Advertisement
Add Comment
Please, Sign In to add comment