title: Lambda function not working properly
body: <p>I am trying to write a lambda function to do the same program which I already implemented using a <code>while</code> loop, but I am not able to figure out how to correct my current program using the lambda function.  As here, I want to multiply 4 with decreased value of <code>n</code>.  For example, 3 should work like <code>4*3=12</code> and then <code>12*2=24</code>, but here it's multiplying 4 always with 3 if <code>n=3</code>. Using a <code>while</code> loop, I wrote this program like below given in <code>foo</code> function.
  It's not factorial; basically, I want to print this series for different values of n like:</p>
  
  <pre><code>n=1 ans=4,
  n=2 ans=8,
  n=3 ans=24,
  n=4 ans=96,
  n=5 ans= 480.
  </code></pre>
  
  <p>The logic in <code>foo</code> function is generating this output.</p>
  
  <pre><code>foo= lambda n: 4*n**~-n
  </code></pre>
  
  <hr>
  
  <pre><code>def foo(n):
    a=4
    i=1
    while i&lt;=n:
        a*=i
        i+=1
    return a
  print(foo(7)) #20160
  </code></pre>