Re:The scope of index variables in Python's for loops
by rhizome31 on Sunday January 18, 2015 @03:42PM
(#8908790)
You can capture the index with a keyword argument default value:
FWIW I played around with this issue in various languages in this blog post: https://my.smeuh.org/al/blog/lost-in-scope
Once you get the difference between block scope and function scope, it's quite easy to see what's happening.
[ Parent
| on HN ]
There are no comments on this comment yet.