Advertisement
pacho_the_python

Untitled

Oct 4th, 2021
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. number = int(input())
  2.  
  3. total_left = 0
  4. total_right = 0
  5. for i in range(1, number + 1):
  6.     num1 = int(input())
  7.     num2 = int(input())
  8.     if i == 1:
  9.         total_left = num1 + num2
  10.     if i == 2:
  11.         total_right = num1 + num2
  12.  
  13. if total_left == total_right:
  14.     print(f"Yes, sum = {total_left}")
  15. else:
  16.     difference = abs(total_left - total_right)
  17.     print(f"No, diff = {difference}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement