Last active
May 15, 2016 00:28
-
-
Save MuddyBootsCode/fdf95e4f6bcf696422adda41eda0567c to your computer and use it in GitHub Desktop.
This file contains 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
divisors = [] | |
userNumber = int(input('Please give me a number and I\'ll give you all of that numbers divisors.\n')) | |
userRange = range(userNumber + 1) | |
for i in range(len(userRange)): | |
try: | |
if userNumber % userRange[i] == 0: | |
divisors.append(userRange[i]) | |
except ZeroDivisionError: | |
pass | |
print (divisors) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment