Sichanov

radoslav toy shop

Jul 11th, 2021
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.22 KB | None | 0 0
  1. price_of_vacation_trip = float(input())
  2. number_of_puzzles = int(input())
  3. number_of_dolls = int(input())
  4. number_of_stuffed_bears = int(input())
  5. number_of_minions = int(input())
  6. number_of_trucks = int(input())
  7.  
  8. number_of_all_toys = number_of_puzzles + \
  9.                      number_of_dolls + \
  10.                      number_of_stuffed_bears + \
  11.                      number_of_minions + \
  12.                      number_of_trucks
  13.  
  14. puzzle_price = 2.60
  15. doll_price = 3
  16. stuffed_bear_price = 4.10
  17. minion_price = 8.20
  18. truck_price = 2
  19.  
  20. profit_for_toys = (puzzle_price * number_of_puzzles) + \
  21.                   (doll_price * number_of_dolls) + \
  22.                   (stuffed_bear_price * number_of_stuffed_bears) + \
  23.                   (minion_price * number_of_minions) + \
  24.                   (truck_price * number_of_trucks)
  25.  
  26. if number_of_all_toys >= 50:
  27.     profit_for_toys *= 0.75
  28.  
  29. shop_rent = profit_for_toys * 0.1
  30. final_profit = profit_for_toys - shop_rent
  31.  
  32. if final_profit >= price_of_vacation_trip:
  33.     money_left = final_profit - price_of_vacation_trip
  34.     print(f"Yes! {money_left:.2f} lv left.")
  35. else:
  36.     money_needed = price_of_vacation_trip - final_profit
  37.     print(f"Not enough money! {money_needed:.2f} lv needed.")
  38.  
Advertisement
Add Comment
Please, Sign In to add comment