Skip to content

Instantly share code, notes, and snippets.

@desimone
Created May 22, 2014 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save desimone/ad870f7937b2a5cd8cb3 to your computer and use it in GitHub Desktop.
Save desimone/ad870f7937b2a5cd8cb3 to your computer and use it in GitHub Desktop.
factors using generators
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