#!/usr/bin/python
def factors(n):
for i in range(2,n):
if (n % i == 0): yield i
for a in factors(42):
print a
Click here to download c24/factors.py.
#!/usr/bin/python
def factors(n):
for i in range(2,n):
if (n % i == 0): yield i
for a in factors(42):
print a