Advertisement
dgodinov

toy_shop_daniel

Apr 12th, 2021
514
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.08 KB | None | 0 0
  1. excursion = float(input())
  2. qty_puzzle = int(input())
  3. qty_dolls = int(input())
  4. qty_teddy_bear = int(input())
  5. qty_minions = int(input())
  6. qty_trucks = int(input())
  7.  
  8. price_puzzle = 2.60
  9. price_doll = 3
  10. price_teddy_bear = 4.10
  11. price_minion = 8.20
  12. price_truck = 2
  13.  
  14. qty_all_toys = qty_puzzle + qty_dolls + qty_teddy_bear + qty_minions + qty_trucks
  15. sum_all_toys = qty_puzzle * price_puzzle + qty_dolls * price_doll + qty_teddy_bear * price_teddy_bear + qty_minions * price_minion + qty_trucks * price_truck
  16.  
  17. if qty_all_toys >50:
  18.     price_after_discount = sum_all_toys * 0.75
  19.     rent = price_after_discount * 0.10
  20.     if price_after_discount - rent > excursion:
  21.         print(f"Yes! {price_after_discount-rent-excursion:.2f} lv left.")
  22.     else:
  23.         print(f"Not enough money! {excursion - (price_after_discount-rent):.2f} lv needed.")
  24. else:
  25.     rent = sum_all_toys * 0.10
  26.     if sum_all_toys - rent > excursion:
  27.         print(f"Yes! {sum_all_toys - rent-excursion:.2f} lv left.")
  28.     else:
  29.         print(f"Not enough money! {excursion - (sum_all_toys - rent):.2f} lv needed.")
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement