Created
May 29, 2017 10:27
-
-
Save ashokbharat/43318180dffa1791b2c5e46575b0291d to your computer and use it in GitHub Desktop.
Divisors
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
''' To print all divisors of a number''' | |
num = int(input("Enter a number to print all the divisors")) | |
new_list = [] | |
for x in range(1,num+1): | |
if(num%x==0): | |
new_list.append(x) | |
else: | |
continue | |
print(new_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment