A list of lambda functions is created in a loop, each one meant to return its own loop index (0, 1, 2). But when called, every single one returns 2.
Python closures capture variables by reference, not by value, and lambdas don't evaluate the variable until they are CALLED (late binding). By the time all the lambdas run, the loop has already finished, so they all see the loop variable's final value.