Skip to content

Instantly share code, notes, and snippets.

@AnnikaNoren
Created November 16, 2020 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AnnikaNoren/d84a891f25cbcaa1325d619df66405f5 to your computer and use it in GitHub Desktop.
Save AnnikaNoren/d84a891f25cbcaa1325d619df66405f5 to your computer and use it in GitHub Desktop.
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