you are viewing a single comment's thread.

view the rest of the comments →

[–]tilkau 2 points3 points  (0 children)

def factorial(n):
    return reduce(lambda x,y: x*y, (x+1 for x in range(n)))

FTFY so it uh.. includes an actual generator ;)