I am a beginer in Python programing, so i start with simple programs.

I try to find out the divisors shared by the two numbers.

I need some help. Thanks in advance.

a = int(input("\n Enter the first number a = ")) b = int(input("\n Enter the second number b = ")) x = [] for i in range (1, a+1): if(a % i == 0): x.append(i) print("\n " + str(x)) y = [] for j in range (1, b+1): if(b % j == 0): y.append(j) print("\n " + str(y)) z = [] for m in range (len(x)): for n in range (len (y)): if(x[m] == y[n]): z.append(n) print("\n " + str(z))