Each error has three parts: what it looks like, why it happens, and exactly how to fix it. Start with the error Python is showing you โ jump straight to that section.
Python always tells you: (1) the error type, (2) the line number, (3) what went wrong. Most students ignore the message and guess. Reading it takes 10 seconds and usually shows you exactly where to look.
You do not need to understand Python to help. Read the error message with your child. Find the line number. Look at this guide. The fixes are written in plain English.
"Python keeps shouting about spaces and I don't understand why."
if age >= 18:
print("You can vote") # โ No indent!
# IndentationError: expected an indented blockPython uses indentation (spaces at the start of lines) to show structure โ which lines belong inside an if, loop, or function. If the indentation is wrong or inconsistent, Python cannot understand the structure.
"But I used that variable right there! Why does Python say it doesn't exist?"
print(score) # โ Using before creating score = 100 # NameError: name "score" is not defined
Python reads your code top to bottom, line by line. If you use a variable before you've created it, Python genuinely does not know what it is yet. Spelling matters too โ Score and score are different variables.
"I'm trying to add things together and Python is complaining."
age = input("How old are you? ")
if age >= 18: # โ TypeError!
# TypeError: ">=" not supported between str and intinput() always returns a string โ even if the user types a number. "18" the string and 18 the integer are different things. You cannot compare or do maths on them without converting.
Wrap input() with int() when you need a number: age = int(input("How old are you? ")). Use float() for decimal numbers. Use str() to convert a number back to text for display.
"Python says there's an error but the line looks fine to me."
if x = 5: # โ Should be ==
for i in range(5) # โ Missing colon
print("Hello) # โ Missing closing quoteSyntaxError is almost always one missing character. Scan the flagged line character by character. If nothing is obvious, look at the line above.
"My list exists and has things in it โ why is Python saying the index is out of range?"
names = ["Ali", "Beth", "Carlos"] print(names[3]) # โ IndexError! # IndexError: list index out of range # (List has 3 items: index 0, 1, 2)
Python lists start at index 0, not 1. A list with 3 items has indexes 0, 1, and 2. Index 3 does not exist. This is called zero-indexing and trips up almost every beginner.
Sometimes an error needs a second pair of eyes. Miss ICT Python sessions work through exactly these problems โ calmly, clearly, and at your pace.
Python finds errors when it tries to compile your code. By that point, the damage from a missing character several lines earlier has already propagated. Always check the line above and below the flagged line.
No โ that is a logic error. Python is doing exactly what you told it to do, but what you told it is not what you meant. Add print() statements to show what your variables actually contain at each step.
Other languages use brackets to show structure. Python chose indentation instead โ it makes code more readable. The trade-off is that spaces matter more. 4 spaces per indent level, consistently.