Skip to content

Instantly share code, notes, and snippets.

@azdafirmansyah
Last active November 30, 2017 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azdafirmansyah/fe55b0797f181d229bff41d46e7bedb5 to your computer and use it in GitHub Desktop.
Save azdafirmansyah/fe55b0797f181d229bff41d46e7bedb5 to your computer and use it in GitHub Desktop.
Divisors
# exercise URL : http://www.practicepython.org/exercise/2014/02/26/04-divisors.html
'''
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.)
'''
input_data = int(input("Input number : "))
x = []
for i in range(1,100):
if i % input_data == 0:
x.append(i)
print(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment