'Recursion is the GOTO of functional programming.' -- Erik Meijer
PUBLISHED ON JUN 30, 2016 —
IMPORTED FROM TUMBLR
,
TEXT
def fact(n): return reduce(lambda x, y: x * y, range(1, n + 1)) print(fact(5)) #=> 120
< prev |
blog
| next >
home