Scratch My Blocks as Python functions
Makes a Python function, like defining a Scratch My Block once. Run it any time by calling its name, e.g. greet(). Inputs become parameters, so you reuse the code instead of copying blocks.
Understanding Scratch My Blocks as Python functions in ACARA Digital Technologies Years 7–8
What it does: The Scratch block input becomes a parameter inside the brackets of the def line. Calling the same function three times reuses one definition, just like using a My Block three times instead of copying its blocks. The 'define' hat block becomes def. For example, def jump(): is like define jump. Functions let you reuse code. You write the steps once with def, then call the name whenever you need them. A def line must end with a colon. Without the colon Python gives a syntax error.
Common mistakes: Writing only the name does not run the function. Like dragging out a My Block, you must call it with brackets: jump(). The call is missing its closing bracket. The block input 3 must go inside a full pair of brackets: spin(3).
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
defFill in the Blanks
Spot the Error
Student with a class code? Join your class →