print() inside a function versus return
Hands a value back to the caller so it can be stored in a variable or used in a calculation. print() inside a function only shows the value on screen, and the function then gives back None.
Understanding print() inside a function versus return in ACARA Digital Technologies Years 7–8
What it does: This only works well when add() uses return. The value 5 is stored in total and can be used later. A returned value of 5 can be multiplied by 2 to give 10. A function that only prints would give None and cause an error. add() gives back None, and Python cannot add None and a number. You need return a + b for this to work. return sends the value out of the function, so the caller can keep it in a variable or use it in maths.
Common mistakes: print() only shows the sum on screen and the function then gives back None. So total holds None, not 5. The line should be 'return a + b' so the value is handed back and can be stored. print() shows the temperature but the function returns None. Comparing None > 70 causes a TypeError. Use 'return c * 9 / 5 + 32' so the result can be used in the comparison.
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 522–560) and word search (Modules 522–580).
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 →