[ create a new paste ] login | about

Link: http://codepad.org/qQmtbD7S    [ raw code | output | fork ]

Python, pasted on Mar 18:
1
2
3
4
5
def factors(n):
    return filter(lambda i: n % i == 0, range(1, n + 1))

print factors(10)
print factors(100)


Output:
1
2
[1, 2, 5, 10]
[1, 2, 4, 5, 10, 20, 25, 50, 100]


Create a new paste based on this one


Comments: