Advertisement
mbstanchev

Untitled

Jan 18th, 2022
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. buget = float(input())
  2. num_videocard = int(input())
  3. num_prosesors = int(input())
  4. num_ram = int(input())
  5.  
  6. price_videocard = num_videocard * 250
  7. price_prosesor = price_videocard * 0.35
  8. price_ram = price_videocard * 0.1
  9.  
  10. total_price = price_videocard + (price_prosesor * num_prosesors) + (price_ram * num_ram)
  11.  
  12. if num_videocard > num_prosesors:
  13. total_price = total_price * 0.85
  14. difference = abs(buget - total_price)
  15. if buget >= total_price:
  16. print(f"You have {difference:.2f} leva left!")
  17.  
  18. else:
  19. print(f"Not enough money! You need {difference:.2f} leva more!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement