O'Reilly logo
  • Sri Harsha V thinks this is interesting:

After the loop this variable normally still refers to the last item visited, which is the last item in the sequence unless the loop exits with a break statement.


Cover of Learning Python, 5th Edition


The target variable, that is the variable to which each entry in the iterable is assigned, retains the value of the last visited node when the loop exited.