Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save HandsonMatheus/bb8ba57058e114e55770aba6169f7231 to your computer and use it in GitHub Desktop.

Select an option

Save HandsonMatheus/bb8ba57058e114e55770aba6169f7231 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. (If you don’t know what a divisor is, it is a number
that divides evenly into another number.
For example, 13 is a divisor of 26 because 26 / 13 has no remainder.
"""
def divisor(n):
for i in range(1, n+1):
if n % i == 0:
print(i)
print(divisor(n = int(input('Choose a number >>> '))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment