Advertisement
veronikaaa86

07. Shopping

Jul 10th, 2022
437
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_count = int(input())
  3. cpu_count = int(input())
  4. ram_count = int(input())
  5.  
  6. video_sum = video_count * 250
  7. cpu_sum = (video_sum * 0.35) * cpu_count
  8. ram_sum = (video_sum * 0.10) * ram_count
  9.  
  10. total_sum = video_sum + cpu_sum + ram_sum
  11. if video_count > cpu_count:
  12. total_sum = total_sum - (total_sum * 0.15)
  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