Created
December 21, 2015 06:23
-
-
Save utkarshmalik211/e95513fa67a4a2691786 to your computer and use it in GitHub Desktop.
A python programme to print divisor(s) of a given no.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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