#Question : Decompose a positive integer into prime factors. For example: input 90, print out 90=2*3*3*5. #My method should be more concise than online, but the recursion may be slower n = input( ' Please enter a positive integer: ' ) n = int(n) X = str(n) m = [] def zhengchu(n): for i in range(2,n+1): if n % i == 0: k = int(n / i) m.append(i) return zhengchu(k) else: continue y = [str(x) for x in m] print ('%s = '% X,'*'.join(y)) zhengchu(n)