Advertisement
Lyubohd

Untitled

Nov 18th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. price_trip = float(input())
  2. n_puzzels = int(input())
  3. n_dolls = int(input())
  4. n_bears = int(input())
  5. n_minions = int(input())
  6. n_trucks = int(input())
  7. n_toys = n_puzzels + n_dolls + n_bears + n_minions + n_trucks
  8. price_earned = n_puzzels * 2.60 + n_dolls * 3 + n_bears * 4.10 + n_minions * 8.20 + n_trucks * 2
  9.  
  10. if n_toys >= 50:
  11.     price_earned = price_earned - price_earned * 0.25
  12. price_earned = price_earned - price_earned * 0.10
  13. if price_earned >= price_trip:
  14.     money_left = price_earned - price_trip
  15.     print(f'Yes! {money_left:.2f} lv left.')
  16. else:
  17.     money_needed = price_trip - price_earned
  18.     print(f'Not enough money! {money_needed:.2f} lv needed.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement