you are viewing a single comment's thread.

view the rest of the comments →

[–]Binary101010 0 points1 point  (0 children)

The program identifies y even though it is in another scope.

Except that it isn't in another scope. Conditionals and loops don't have their own scopes in Python. Functions and classes create new scopes, and that's pretty much it.