Advertisement
exDotaPro

2019_6_july_2_shopping

Feb 1st, 2020
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. budget = float(input())
  2. video_card_quantity = int(input())
  3. cpu_quantity = int(input())
  4. ram_quantity = int(input())
  5.  
  6. video_card_price = video_card_quantity * 250
  7. cpu_price = cpu_quantity * (video_card_price * 0.35)
  8. ram_price = ram_quantity * (video_card_price * 0.10)
  9. total_price = video_card_price + cpu_price + ram_price
  10.  
  11. if video_card_quantity > cpu_quantity:
  12.     total_price *= 0.85
  13.  
  14. diff = abs(budget - total_price)
  15.  
  16. if budget >= total_price:
  17.     print(f'You have {diff:.2f} leva left!')
  18. else:
  19.     print(f'Not enough money! You need {diff:.2f} leva more!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement