Advertisement
Spocoman

07. Shopping

Dec 16th, 2021 (edited)
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. budget = float(input())
  2. gpu = int(input())
  3. cpu = int(input())
  4. ram = int(input())
  5.  
  6. gpu_price = gpu * 250
  7. cpu_price = cpu * gpu_price * 0.35
  8. ram_price = ram * gpu_price * 0.10
  9.  
  10. total = gpu_price + cpu_price + ram_price
  11.  
  12. if gpu > cpu:
  13.     total *= 0.85
  14.  
  15. if budget >= total:
  16.     print(f'You have {budget - total:.2f} leva left!')
  17. else:
  18.     print(f'Not enough money! You need {total - budget:.2f} leva more!')
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement