GroZnik81

Untitled

May 16th, 2020
27
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. number = int(input())
  2. odd_sum = 0
  3. even_sum = 0
  4.  
  5. for position in range(1 , number +1):
  6. new_number = int(input())
  7. if position % 2 == 0:
  8. even_sum += new_number
  9. else:
  10. odd_sum += new_number
  11.  
  12. if odd_sum == even_sum:
  13. print(f"Yes")
  14. print(f"Sum = {odd_sum}")
  15. else:
  16. print(f"No")
  17. print(f"Diff = {abs(odd_sum- even_sum)}")
RAW Paste Data