I have just started learning python. I came across lambda functions. On one of the problems, the author asked to write a one liner lambda function for factorial of a number.
It is this simple:
n=input() print reduce(lambda x,y:x*y,range(1,n+1))