Created
February 8, 2018 17:59
-
-
Save pyplacca/ef5b1e0cf4482c867265303c5c3b8062 to your computer and use it in GitHub Desktop.
Returns all divisors of a number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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