title: Python lambda function to calculate factorial of a number
body: <p>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. </p>
  
  <p>This is the solution that was given:</p>
  
  <pre><code>num = 5
  print (lambda b: (lambda a, b: a(a, b))(lambda a, b: b*a(a, b-1) if b &gt; 0 else 1,b))(num)
  </code></pre>
  
  <p>I cannot understand the weird syntax. What does a(a,b) mean? </p>
  
  <p>Can someone explain?</p>
  
  <p>Thanks</p>