Loading topic
(3) is not a tuple and spot the accidental tu5 min readappend. It builds on the previous chapters, where you created tuples and indexed and sliced them. It explains exactly what "immutable" promises for a tuple and what it leaves open.6 min readx, y = point, and that you know how lists, slices and for loops work. It builds on those to handle sequences whose length you don't know in advance.6 min readx, y = 3, 4, swaps, and starred targets such as first, *rest = items. You also need for loops and function definitions. This chapter extends those ideas to values that contain other sequences.6 min readfor loop can unpack each item into several names. It then applies that to the three most common sources of paired data: enumerate, zip and dict.items. It assumes you can write a basic for loop and have read the earlier chapters on packing, unpacking and nested unpa6 min readx, y = 3, 4), and have seen starred targets such as first, *rest = items. Here the same two ideas appear at function boundaries. A function hands several results back to its caller, and a caller sp6 min read(1, 2) is compact, but row[2] tells the reader nothing about what the third item means. A named tuple fixes that by giving each position a name, and it stays a real tuple.5 min readfor loops and function calls. It collects the mistakes that come up most often. For each one it gives the cause, the error message you will see, and the fix6 min read