Advertisement
AngelBorislavov

7.Shoping

Mar 16th, 2025
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. budjet = float(input())
  2. gpu_qty = int(input())
  3. cpu_qty = int(input())
  4. ram_qty = int(input())
  5.  
  6. gpu_price = 250.0 * gpu_qty
  7. cpu_factor = gpu_price *  0.35
  8. ram_price = (gpu_price * 0.10) * ram_qty
  9.  
  10. total_price = gpu_price + cpu_factor + ram_price
  11.  
  12.  
  13. if gpu_qty > cpu_qty:
  14.     discount = total_price * 0.15
  15.     total_price -= discount
  16.     # print(total_price)
  17.  
  18. if budjet >= total_price:
  19.     print(f"You have {budjet - total_price:.2f} leva left!")
  20. if budjet < total_price:
  21.     print(f"Not enough money! You need {total_price - budjet:.2f} leva more!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement