Skip to content

Instantly share code, notes, and snippets.

@AnnikaNoren
Created November 16, 2020 16:03
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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