Ddimov90

left_and_right_sum_09_01

Oct 3rd, 2025
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | Source Code | 0 0
  1. nums = int(input())
  2.  
  3. sum_one = 0
  4. sum_two = 0
  5.  
  6. for _ in range(0, nums):
  7.     num = int(input())
  8.     sum_one += num
  9.  
  10. for _ in range(0, nums):
  11.     num = int(input())
  12.     sum_two += num
  13.  
  14. if sum_one == sum_two:
  15.     print(f"Yes, sum = {sum_one}")
  16. else:
  17.     print(f"No, diff = {abs(sum_one - sum_two)}")
  18.  
Advertisement
Add Comment
Please, Sign In to add comment