title: Python lambda return syntax
body: <p>Need some help with this code, can't figure the lambda syntax right here:</p>
  <pre><code>def func(m,n):
     if m &lt; n:
        return ____
     elif m==n:
        return ____
     else:
        return ____
  </code></pre>
  <p>input:</p>
  <pre><code>func(3,10)()()()()()()
  func(3,7)()()()
  func(4,4)()
  func(10,5)()()
  func(9,5)()()
  </code></pre>
  <p>output should be:</p>
  <pre><code>13
  m==n
  m==n
  15
  14
  </code></pre>
  <p>I've tried:</p>
  <pre><code>def func(m, n):
      if m &lt; n:
          return lambda: func(m+1, n-1)
      elif m == n:
          return lambda: print(&quot;m == n&quot;)
      else:
          return lambda: print(n+m)
  </code></pre>
  <p>This function works without errors with main like that:</p>
  <pre><code>func(3,10)()()()()() # ()
  func(3,7)()()()
  func(4,4)()
  func(10,5)() # ()
  func(9,5)() # ()
  </code></pre>
  <p>There is a way to make it work <strong>with</strong> the commented brackets?</p>