human
Equilibrium index of an array | function to find the equilibrium index.
finding the sum of whole array.
total_sum is now right sum for index i.
If no equilibrium index found , then return - 1.
Driver code"
How can the above be solved in Python?

=====
Give me a code to equilibrium index of an array and the other steps required?
assistant
#Here is code to equilibrium index of an array and the other steps required.
 def equilibrium ( arr ) :
	total_sum = sum ( arr )
	leftsum = 0
	for i , num in enumerate ( arr ) :
		total_sum -= num
		if leftsum == total_sum :
			return i
		leftsum += num
	return - 1
arr = [ - 7 , 1 , 5 , 2 , - 4 , 3 , 0 ]
print ( ' First ▁ equilibrium ▁ index ▁ is ▁ ' , equilibrium ( arr ) )