Skip to content

Instantly share code, notes, and snippets.

@prakashgd
Created July 31, 2016 11:48
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 prakashgd/03a0af4827f61fabdea46c2f4c4002ba to your computer and use it in GitHub Desktop.
Save prakashgd/03a0af4827f61fabdea46c2f4c4002ba to your computer and use it in GitHub Desktop.
n = int(input("Enter your number"))
d = n - 1
x = 2
dvr = []
while 2 <= x <= d:
y = n % x
if y == 0:
dvr.append(x)
x += 1
else:
x += 1
print "The divisor of {} are : {}".format(n, dvr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment