Module 1 · Downloading and Installing Python · Lesson 4 of 4
How to spoil (and fix) your code
Here's a secret: every programmer breaks their code constantly. What separates beginners from experts isn't avoiding mistakes — it's reading the error message instead of panicking. So let's break our program on purpose and practise the fix.
Break it, read the error, fix it
hello.py
1prnt("Hello, World!")
Terminal
$ python hello.py
Traceback (most recent call last):
File "hello.py", line 1, in <module>
NameError: name 'prnt' is not defined
↑ Python points at the typo — fix it.
$ python hello.py
Hello, World!
Misspell print as prnt and Python stops with a NameError. That block of red text is a traceback, and it's on your side: it tells you the file, the line number, and exactly what it didn't understand.
Read it from the bottom up — name 'prnt' is not defined — fix the typo, and run it again. Green output, no red. Getting comfortable with this little loop of break → read → fix is genuinely half of learning to code.