Advertisement
veronikaaa86

07. Shopping

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