Created
May 22, 2014 22:29
-
-
Save desimone/ad870f7937b2a5cd8cb3 to your computer and use it in GitHub Desktop.
factors using generators
This file contains hidden or 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
def find_factor(number): | |
for i in range(1, number): | |
if number % i == 0: | |
yield i | |
factors = find_factor(154) | |
for i in factors: | |
print i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment