Sichanov

asd

Jan 21st, 2021
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.97 KB | None | 0 0
  1. price_for_vacancion = float(input())
  2. number_puzzles = int(input())
  3. number_talking_dalls = int(input())
  4. number_teddy_bears = int(input())
  5. number_minions = int(input())
  6. number_trucks = int(input())
  7. puzzles = 2.60
  8. talk_dalls = 3
  9. teddy_bear = 4.1
  10. minions = 8.20
  11. truck = 2
  12. number_of_all_toys = number_puzzles + number_talking_dalls + number_minions + number_teddy_bears + number_trucks
  13. total_sum = (number_puzzles * puzzles) + (number_talking_dalls * talk_dalls) + (number_teddy_bears * teddy_bear) \
  14.     + (number_minions * minions) + (number_trucks * truck)
  15. if number_of_all_toys >= 50:
  16.     discount = total_sum * 0.25
  17.     total_price = total_sum - discount
  18. else:
  19.     total_price = total_sum
  20.  
  21. rent_for_house = total_price * 0.10
  22. profit = total_price - rent_for_house
  23. remainig_money = abs(profit - price_for_vacancion)
  24.  
  25. if price_for_vacancion > profit:
  26.     print(f"Not enough money! {remainig_money:.2f} lv needed.")
  27. else:
  28.     print(f"Yes! {remainig_money:.2f} lv left.")
Advertisement
Add Comment
Please, Sign In to add comment