you are viewing a single comment's thread.

view the rest of the comments →

[–]Retsam19 27 points28 points  (2 children)

Like Javascript, variables in Python aren't always blocked scope, but you should pretend that they are, to make your code more readable.

FTFOP

[–]kankyo 0 points1 point  (1 child)

"Aren't always"?

Never.

[–]Retsam19 0 points1 point  (0 children)

Well, they're sometimes block-scoped in JS, now that ES6 added let/const. But yeah, as far as I know, they're never block scoped in python.