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.
We can use the below lambda expression
fact = lambda n:1 if n==0 else n*fact(n-1) print(fact(5) >>> 120