On Mon, Mar 21, 2016 at 2:12 PM, Ian Kelly <ian.g.ke...@gmail.com> wrote: > On Mon, Mar 21, 2016 at 2:03 PM, Ben Bacarisse <ben.use...@bsb.me.uk> 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