Closed presnick closed 5 years ago
I do not think students need to understand the concept of tuple unpacking to make use of enumerate. This is no less foreign to them than for i in range(5):
and in fact for some comes easier because they see the parallel-ness of the item and the index.
The difference is that they have all the tools to reason through what for i in range(5)
does, but they do not. They may be able to skim over enumerate with tuple unpacking and get the right intuition, but you would have to teach it as magic at this point in the course. I prefer to minimize magic.
fixed
_sources/Iteration/TraversalandtheforLoopByIndex.rst makes use of enumerate and iterating with tuple unpacking.
I think this sub_chapter should be rewritten to not use those.