num = 10
divisors = []
for i in range(2, num):
if num % i == 0:
divisors.append(i)
print(num,'ÀÇ Áø¾à¼ö :', divisors)
############################################
def get_divisors(num): # numÀÇ ¾à¼ö¸¦ ÁýÇÕÇüÀ¸·Î ¹ÝȯÇÔ
divisors = set()
for i in range(2, num):
if num % i == 0:
divisors.add(i)
return divisors
x = 48
print(x, 'ÀÇ Áø¾à¼ö :', get_divisors(x))
y = 60
print(y, 'ÀÇ Áø¾à¼ö :', get_divisors(y))
############################################
A = get_divisors(x)
B = get_divisors(y)
print(A.intersection(B))
print(x, y,'ÀÇ ÃÖ´ë°ø¾à¼ö :', max(A.intersection(B)))