Why do the functions you build inside a loop all end up returning the last value?
Python closures capture variables, not their current values, so functions created in a loop all read the same final loop binding unless you bind a value per iteration. It also connects scoping to the point an interviewer is testing.