I'm looking at your code and was thinking ... why writing code that is difficult to understand?<br><br>To answer your question though, they're different because in case "f", your lambda experssion is only evaluated once. That means the variable 'n' is ever only created once, and replaced repeatedly. In the second case "g", the function is only ever created once, and in effect, the lambda expression is evaluated as a new expression every time the function is called. That's why it may have been what you wanted.<br>

<br>Seriously though, you should use a generater instead. And if that doesn't work for you, just make a function mate. Way easier to read, and you don't have to have ugly calls like f[0](3).<br><br>>>> def powers(n):<br>

...     for x in xrange(2,5):<br>...         yield x ** n<br>...<br>>>> for result in powers(3):<br>...     print result<br>...<br>8<br>27<br>64<br><br>Cheers,<br>Xav<br>