Skip to content

Instantly share code, notes, and snippets.

@utkarshmalik211
Created December 21, 2015 06:23
Show Gist options
  • Save utkarshmalik211/e95513fa67a4a2691786 to your computer and use it in GitHub Desktop.
Save utkarshmalik211/e95513fa67a4a2691786 to your computer and use it in GitHub Desktop.
A python programme to print divisor(s) of a given no.
try:
val1=int(input("Enter a whole no : "))
except ValueError:
print("pls enter a whole integer ")
except KeyboardInterrupt:
print("As your wish")
else:
for e in range(1,100):
"""using 1 in range(1,100) to avoid ZeroDivisionError"""
if val1 % e == 0:
print(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment