def a(num1, num2, lis=list()):
if num2 < 1:
return lis
if not divmod(num1, num2)[1]:
lis.append(num2)
return a(num1, num2=num2-1, lis=lis)
>>> a(7)
[7, 1]
>>> a(78,78)
[78, 39, 26, 13, 6, 3, 2, 1]
本文作者已授权快版权,转载请经授权,侵权必究。