Skip to content

Instantly share code, notes, and snippets.

@ehedaoo
Created May 6, 2017 04:18
Show Gist options
  • Save ehedaoo/6046cada09ecfecc95798d7869abbb88 to your computer and use it in GitHub Desktop.
Save ehedaoo/6046cada09ecfecc95798d7869abbb88 to your computer and use it in GitHub Desktop.
Create a program that asks the user for a number and then prints out a list of all the divisors of that number.
# Create a program that asks the user for a number
# and then prints out a list of all the divisors of that number.
num = int(input("Enter a number"))
check = list(range(1, num+5))
for number in check:
if num % number == 0:
print(number)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment