The Locomotive Engineer exercise is about packing and unpacking. The exercise, on the whole, is very nice. However, the fix_wagon_depot() requires transposing a 2D list. Most solutions use zip() and many students I’ve seen in the mentoring queue are quite confused about how to solve this and, when they look at community solutions, what zip() is and how this works.
Would it make sense to rethink/remove this last function?
Yes, I have mentored a few people on the exercises and what I found as well is that some students have found the last function confusing. The point of the last function is to teach the student of functions in python where you have to “unpack”. I think there could make sense to rethink the last function.
Unfortunately, a single encounter (or a few) does not make familiar. This is not critisism of the track.
It seems that the students expressing confusion about zip during mentoring sessions have somehow avoided it in prior exercises, or have forgotten about it, or failed to notice it. Whatever the case, these students are not familiar with zip.
I’m not sure that trying to plug the holes that these students slipped through is a viable approach. Or should I say: I expect it to be not as fruitful as one would like.
The exact solution is indeed in the hints file, but it does not explain how the zip works with the 2d list of tuples. Most explanations of how zip works use the same example [(1,2,3), (‘red’,‘green’,‘blue’)] or some such.
Perhaps a link to one of the tutorials that might go in a little more depth such as the RealPython page? Or another, better one where someone can look for more depth. Google searches mostly come up with the simple example.
I like that Real Python article. Excellent suggestion. I just wish RP wasn’t so aggressive with signup and paywalling. I’ll take a look and see if there are additional articles that might help. We might also call out zip() in a Exercism note in the instructions, and make sure that the example is one that maps better to the task.
Ultimately, Matthijs and Isaac do have a point - having a concept article and/or specific concept exercise is probably the ideal solution (maybe in conjunction with some other built-in iterator-related functions) – or we include zip() as part of an iterators concept exercise. However, that’s probably not going to happen right away.
I know a band-aid is not ideal, but I also think its better than nothing. Unless we can replace the zip() with something else in that last task?