Sichanov

ee

Jan 15th, 2021
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.97 KB | None | 0 0
  1. excursion_price = float(input())
  2. puzzle_count = int(input())
  3. talking_doll_count = int(input())
  4. plushy_bear_count = int(input())
  5. minion_count = int(input())
  6. truck_count = int(input())
  7.  
  8. puzzle = 2.60
  9. talking_doll = 3
  10. plushy_bear = 4.10
  11. minion = 8.20
  12. truck = 2
  13. total_price_after_discount = 0
  14. rent = 0.9
  15. total_toy_count = puzzle_count + talking_doll_count + plushy_bear_count + minion_count + truck_count
  16.  
  17. total_price = (puzzle_count * puzzle) + (talking_doll * talking_doll_count) + (plushy_bear * plushy_bear_count) + \
  18.               (minion * minion_count) + (truck * truck_count)
  19.  
  20. if total_toy_count >= 50:
  21.     total_price_after_discount = total_price - (total_price/4)
  22. else:
  23.     total_price_after_discount = total_price
  24. if excursion_price > total_price_after_discount*rent:
  25.     print(f'Not enough money! {excursion_price - total_price_after_discount * rent:.2f} lv needed.')
  26. else:
  27.     print(f'Yes! {total_price_after_discount * rent - excursion_price:.2f} lv left.')
  28.  
Advertisement
Add Comment
Please, Sign In to add comment