Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def factors(num):
i = 2
factors = []
while i <= num:
if (num % i) == 0:
factors.append(i)
num = num / i
else:
i = i + 1
return(factors)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment