Created
January 24, 2018 15:50
-
-
Save ysnerdem/0bd0acc19d0470d0f1b3899e212a9116 to your computer and use it in GitHub Desktop.
find the odd divisors of the given number with list comprehension
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
num = int(input("enter a number:")) | |
lst = [i for i in range(1, num) if num % i == 0 and i % 2 != 0] | |
print(lst) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment