def fact(n): return reduce(lambda x, y: x * y, range(1, n + 1)) print(fact(5)) #=> 120
'Recursion is the GOTO of functional programming.' -- Erik MeijerJun 30, 2016 · Christopher Boette def fact(n): return reduce(lambda x, y: x * y, range(1, n + 1)) print(fact(5)) #=> 120