Coding · Grade 6
Functions and Parameters
Learners define and call their own Python functions, follow the flow of control into and out of a function, pass arguments to parameters by position, and see the difference between returning a value and printing it. Robot puzzles with a reusable 'hop' function and a look at local variables show why functions make programs shorter, clearer and easier to change.
- 4 lessons
- About 80 minutes
- Check what you learned: 8 questions
- Ways to answer: fill in the blanks, program with blocks, choose an answer, put code in order, trace code and match pairs
What learners will discover
- Define and call functions and trace the flow of control into a function body and back.
- Pass arguments to parameters, matched by position, and predict the result of each call.
- Distinguish return from print and use returned values in expressions and assignments.
- Use functions to remove repetition and explain that variables created inside a function are local.
Lessons
-
Defining and calling functions 6 steps3 practiceabout 18 min
-
Parameters and arguments 6 steps4 practiceabout 20 min
-
return versus print 6 steps4 practiceabout 20 min
-
Reuse and local variables 5 steps2 practiceabout 18 min
-
Check what you learned 8 questions at the end
Keep exploring
Games to practice with
- Robot RoutesSnap together arrow, repeat and dance blocks to guide Bolt the robot home.
- Bug DetectiveA robot program almost works. Run it, spot the buggy block, and fix it.
- Sorting FactoryTurn a work order into if/else rules and watch the conveyor sort every item.
More 6th grade coding
- 6th Grade Coding Games5 games to play free
- 6th Grade Coding Worksheets10 printable worksheets
Guide for grown-ups
- How to start homeschooling: a step-by-step guide for familiesA guide for parents · 7 min read