human
Count of array elements which are greater than all elements on its left | Function to return the count of array elements with all elements to its left smaller than it.
Stores the count.
Stores the maximum.
Iterate over the array.
If an element greater than maximum is obtained.
Increase count.
Update maximum.
Driver Code"
How can the above be solved in Python?

Give me a code to count of array elements which are greater than all elements on its left and the other steps required?
assistant
#Here is code to count of array elements which are greater than all elements on its left and the other steps required.
 def count_elements ( arr ) :
	count = 1
	max = arr [ 0 ]
	for i in range ( 1 , len ( arr ) ) :
		if arr [ i ] > max :
			count += 1
			max = arr [ i ]
	return count
arr = [ 2 , 1 , 4 , 6 , 3 ]
print ( count_elements ( arr ) )