human
Find an array element such that all elements are divisible by it | Function to find smallest num.
Traverse for all elements.
Stores the minimum if it divides all.
Driver code"
How can the above be solved in Python?
 ... Can you provide a code to find an array element such that all elements are divisible by it and the other steps required?
assistant
#Here is code to find an array element such that all elements are divisible by it and the other steps required.
 def findSmallest ( a , n ) :
	for i in range ( 0 , n ) :
		for j in range ( 0 , n ) :
			if ( ( a [ j ] % a [ i ] ) >= 1 ) :
				break
		if ( j == n - 1 ) :
			return a [ i ]
	return - 1
a = [ 25 , 20 , 5 , 10 , 100 ]
n = len ( a )
print ( findSmallest ( a , n ) )