Skip to content

Instantly share code, notes, and snippets.

@pyplacca
Created February 8, 2018 17:59
Show Gist options
  • Save pyplacca/ef5b1e0cf4482c867265303c5c3b8062 to your computer and use it in GitHub Desktop.
Save pyplacca/ef5b1e0cf4482c867265303c5c3b8062 to your computer and use it in GitHub Desktop.
Returns all divisors of a number
def divisor():
number = int(input("Pick a number: "))
divisors = []
for i in range(1,number + 1):
if number % i == 0:
divisors.append(i)
return ("Divisors of " + str(number) + " = " + str(divisors))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment