input: def split_equal_sum(arr):
      n = len(arr)
      leftsum = 0
      rightsum = sum(arr)
      
      for i in range(n):
          rightsum -= arr[i]
          if leftsum == rightsum:
              return True
          leftsum += arr[i]
      return False
  
  """
  Write a function in python to split an given array into two parts with equal sum.
  >>> split_equal_sum([1, 2, 3, 4])
  False
  >>> split_equal_sum([1, 2, 3, 4, 5, 6, 7, 8])
  True
  """
output:     n = len(arr)
      leftsum = 0
      rightsum = sum(arr)
      
      for i in range(n):
          rightsum -= arr[i]
          if leftsum == rightsum:
              return True
          leftsum += arr[i]
      return False