def num_a(a):
if isinstance(a,int) and a > 1:
lst =[]
for i in range(2,a):
for j in range(2,i):
if i%j == 0:
break
else:
lst.extend(num_b(a,i))
return print("分解的质因子:%s=%s"%(a,'*'.join([str(i) for i in lst])))
else:
return a
def num_b(n,x):
b = n
lst = []
for i in range(n):
if b%x ==0:
lst.append(x)
b = b//x
return lst
num_a(100)
num_a(88)