Advertisement
veronikaaa86

07. Shopping

Mar 6th, 2022
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. budget = float(input())
  2. video_cards_count = int(input())
  3. proc_count = int(input())
  4. ram_count = int(input())
  5.  
  6. video_card_sum = video_cards_count * 250
  7. proc_sum = (video_card_sum * 0.35) * proc_count
  8. ram_sum = (video_card_sum * 0.10) * ram_count
  9.  
  10. total_sum = video_card_sum + proc_sum + ram_sum
  11.  
  12. if video_cards_count > proc_count:
  13. total_sum = total_sum * 0.85
  14.  
  15. diff = abs(total_sum - budget)
  16. if budget >= total_sum:
  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