Advertisement
denislav5

shopping

Sep 18th, 2023
825
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. budget = float(input())
  2. number_of_video_cards = int(input())
  3. number_of_processors = int(input())
  4. number_of_ram_memories = int(input())
  5.  
  6. total_video_cards = number_of_video_cards * 250
  7. total_processors = (0.35 * total_video_cards)*number_of_processors
  8. total_ram_memories = (0.1 * total_video_cards)*number_of_ram_memories
  9. needed_money = total_video_cards + total_ram_memories + total_processors
  10. if number_of_video_cards > number_of_processors:
  11.     needed_money *= 0.85
  12. difference = abs(budget - needed_money)
  13. if needed_money >= budget:
  14.     print(f"Not enough money! You need {difference:.2f} leva more!")
  15. else:
  16.     print(f"You have {difference:.2f} leva left!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement