You are viewing a single comment's thread. Return to all comments →
This was a bit complex. but passed all tests
def factor(n): (res_list, i)=([1],2) while n != 1: if n%i == 0: while n%i == 0: n = n//i res_list.append(i) i = i+1 if i*i <= n else n return res_list
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #3: Largest prime factor
You are viewing a single comment's thread. Return to all comments →
This was a bit complex. but passed all tests