human
Sum of common divisors of two numbers A and B | print the sum of common factors.
sum of common factors.
iterate from 1 to minimum of a and b.
if i is the common factor of both the numbers.
Driver Code.
print the sum of common factors"
How can the above be solved in Python?
 ... Give me a code to sum of common divisors of two numbers A and B and the other steps required?
assistant
#Here is code to sum of common divisors of two numbers A and B and the other steps required.
 def sum ( a , b ) :
	sum = 0
	for i in range ( 1 , min ( a , b ) ) :
		if ( a % i == 0 and b % i == 0 ) :
			sum += i
	return sum
A = 10
B = 15
print ( " Sum ▁ = " , sum ( A , B ) )