Arksiana

7. Toy Shop

Nov 8th, 2020
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. price_trip = float(input())
  2. count_puzzle = int(input())
  3. count_dolls = int(input())
  4. count_bears = int(input())
  5. count_minions = int(input())
  6. count_trucks = int(input())
  7.  
  8. price_toys = count_puzzle * 2.60 + count_dolls * 3 + count_bears * 4.10 + count_minions * 8.20 + count_trucks * 2
  9. count_toys = count_trucks + count_bears + count_puzzle + count_minions + count_dolls
  10.  
  11. if count_toys >= 50:
  12. price_toys -= 0.25 * price_toys
  13.  
  14. rent = 0.10 * price_toys
  15. all_money = price_toys - rent
  16. if all_money >= price_trip:
  17. print(f"Yes! {abs(price_trip - all_money):.2f} lv left.")
  18. else:
  19. print(f"Not enough money! {abs(all_money - price_trip):.2f} lv needed.")
Advertisement
Add Comment
Please, Sign In to add comment