Common function mistakes: print instead of return
Sends a value back to the caller. If a function only prints and has no return, it gives back None, so the caller cannot use the result.
Understanding Common function mistakes: print instead of return in ACARA Digital Technologies Years 9–10
What it does: Because return is indented inside the for loop, the function exits after the first number instead of adding them all. result is local to make_total(), so return is the way to send its value out to the code that called the function. print() only shows the value on screen. return sends it back, so x = double(4) stores 8. With print, x would be None. Arguments match parameters by position. Swapping them gives name = 15 and age = "Mia", which causes an error or a wrong result. The caller needs a real number to add 10 to. Using return w * h gives it one.
Common mistakes: The parameters are in the wrong order. The call take_away(10, 4) puts 10 into small and 4 into big, so the function returns -6 instead of 6. The header should be def take_away(big, small):. The function prints the answer instead of returning it, so x is None and x + 1 causes a TypeError. The line should be return n * 2.
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 629–680) and word search (Modules 629–707).
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
returnFill in the Blanks
Spot the Error
Student with a class code? Join your class →