Sichanov

ttt

May 20th, 2021
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. excursion_price = float(input())
  2. puzzles_cnt = int(input())
  3. dolls_cnt = int(input())
  4. bears_cnt = int(input())
  5. minions_cnt = int(input())
  6. trucks_cnt = int(input())
  7. total_price = 0
  8. sum_of_sales = puzzles_cnt * 2.60 + dolls_cnt * 3 + bears_cnt * 4.10 + minions_cnt * 8.20 + trucks_cnt * 2
  9. number_of_toys = puzzles_cnt + dolls_cnt + bears_cnt + minions_cnt + trucks_cnt
  10.  
  11. if number_of_toys >= 50:
  12.     sum_of_sales = sum_of_sales * 0.75
  13.  
  14. sum_of_sales = sum_of_sales * 0.90
  15.  
  16. if sum_of_sales >= excursion_price:
  17.     money_left = sum_of_sales - excursion_price
  18.     print(f"Yes! {money_left:.2f} lv left.")
  19. else:
  20.     needed_money = excursion_price - sum_of_sales
  21.     print(f"Not enough money! {needed_money:.2f} lv needed.")
Advertisement
Add Comment
Please, Sign In to add comment