Runtime errors in Python
An error that stops a program while it runs, shown as a named error like NameError, ValueError or ZeroDivisionError. Read the message to find the problem.
Understanding Runtime errors in Python in VCE Software Development U3O1
What it does: int("hello") cannot turn the word into a number. The program stops with a ValueError while it runs. Start prints, then 10 / 0 causes a ZeroDivisionError. The program stops, so End never prints. Python raises a NameError when you use a variable name that has not been created yet. Check the spelling or create the variable first. The message tells you the type of error (like NameError) and which line caused it. This helps you find the problem fast. A runtime error only stops the program at the broken line. Earlier lines such as print('Hi') have already run.
Common mistakes: The variable totl was never created, so Python stops with a NameError. The name must match the variable made earlier: total. You cannot divide by zero. Python stops with a ZeroDivisionError. Divide by a number that is not zero, such as 4.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 156–166) and word search (Modules 142–166).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
runtime errorFill in the Blanks
Spot the Error
Student with a class code? Join your class →