def count_factors(): n = int(input('input the num:')) num = n res = [] while n > 1: for i in range(2, n+1): if n % i == 0: n = int(n/i) res.append(i) break print('{}={}'.format(num, res))
输出:
input the num:9090=[2, 3, 3, 5]