Sichanov

ee

Jan 16th, 2021
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. price_of_holiday = float(input())
  2. amount_puzzles = int(input())
  3. amount_talking_dolls = int(input())
  4. amount_plush_bears = int(input())
  5. amount_minions = int(input())
  6. amount_truckies = int(input())
  7. discount = 0
  8. price_of_puzzle = 2.60
  9. price_of_talking_doll = 3
  10. price_of_plush_bear = 4.10
  11. price_of_minion = 8.20
  12. price_of_trucky = 2
  13.  
  14. sum = amount_puzzles * price_of_puzzle + amount_talking_dolls * price_of_talking_doll + amount_plush_bears * price_of_plush_bear + amount_minions * price_of_minion + amount_truckies * price_of_trucky
  15.  
  16. total_amount_of_toys = amount_puzzles + amount_talking_dolls + amount_plush_bears + amount_minions + amount_truckies
  17. if total_amount_of_toys >= 50:
  18.     discount = sum * 0.25
  19. elif total_amount_of_toys < 50:
  20.     sum = sum
  21.  
  22. final_sum = sum - discount
  23. profit = final_sum * 0.9
  24. if profit >= price_of_holiday:
  25.     print(f'Yes! {profit - price_of_holiday:.2f} lv left.')
  26. elif profit < price_of_holiday:
  27.     print(f'Not enough money! {price_of_holiday - profit:.2f} lv needed.')
Advertisement
Add Comment
Please, Sign In to add comment