human
Common divisors of N numbers | Function to calculate gcd of two numbers.
Function to prall the common divisors.
Variable to find the gcd of N numbers.
Set to store all the common divisors.
Finding GCD of the given N numbers.
Finding divisors of the HCF of n numbers.
Prall the divisors.
Driver 's Code.
Function to prall the common divisors"
How can the above be solved in Python?
 ... Can you provide a code to common divisors of N numbers and the other steps required?
assistant
#Here is code to common divisors of N numbers and the other steps required.
 def gcd ( a , b ) :
	if ( a == 0 ) :
		return b
	return gcd ( b % a , a )
def printAllDivisors ( arr , N ) :
	g = arr [ 0 ]
	divisors = dict ( )
	for i in range ( 1 , N ) :
		g = gcd ( arr [ i ] , g )
	for i in range ( 1 , g + 1 ) :
		if i * i > g :
			break
		if ( g % i == 0 ) :
			divisors [ i ] = 1
			if ( g // i != i ) :
				divisors [ g // i ] = 1
	for it in sorted ( divisors ) :
		print ( it , end = " ▁ " )
if __name__ == ' _ _ main _ _ ' :
	arr = [ 6 , 90 , 12 , 18 , 30 , 24 ]
	n = len ( arr )
	printAllDivisors ( arr , n )