Advertisement
JordanB

ex7 Shopping - Conditional Statements - Exercise

Jan 13th, 2023
1,217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. budgetPesho = float(input())
  2. GPUs = int(input())
  3. CPUs = int(input())
  4. discount = 0
  5. if GPUs > CPUs:
  6.     discount = 0.15
  7. GPUs *= 250
  8. CPUs *= GPUs*35/100
  9. RAMs = int(input()) * GPUs/10
  10.  
  11. parts_cost = GPUs+CPUs+RAMs
  12. final_cost = parts_cost - parts_cost*discount
  13.  
  14. if final_cost < budgetPesho:
  15.     print(f'You have {(budgetPesho - final_cost):.2f} leva left!')
  16. else:
  17.     print(
  18.         f'Not enough money! You need {(final_cost - budgetPesho):.2f} leva more!')
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement