Dark theme

Close reading


Programming requires inhuman levels of accuracy – literally: computers demand absolute accuracy of spelling and grammar in ways humans aren't used to, and, in some respects, are largely incapable of. Typing code accurately first time is rare – it is much more usual to have to go back through your code using the Python messages and sort issues of syntax. In this section we'll practice a few of these. The secret to solving these is close-reading: getting use to reading every word in a program carefully while thinking whether it is correct.

Here's an example of some code that is trying to construct a 2D list: test1.py. Without running it, can you see what the issue is? Don't correct it yet - once you think you know what the issue is, run it and see what Python's issue message is.