On Mon, Mar 21, 2016 at 2:12 PM, Ian Kelly <[email protected]> wrote: > On Mon, Mar 21, 2016 at 2:03 PM, Ben Bacarisse <[email protected]> wrote: >> For experts here: why can't I write a lambda that has a statement in it >> (actually I wanted two: lambda l, i: l[i] += 1; return l)? > > https://docs.python.org/3/faq/design.html#why-can-t-lambda-expressions-contain-statements
tl;dr: If you want a function with a statement in it, use def, not lambda. -- https://mail.python.org/mailman/listinfo/python-list
