| Lesson Plan |
| Grade: |
Date: 03/03/2026 |
| Subject: Computer Science |
| Lesson Topic: Define and use a function |
Learning Objective/s:
- Describe the purpose and main components of a function (definition, parameters, return value, scope).
- Explain how to write and invoke a function using Python‑style syntax.
- Apply correct parameter passing and return statements to solve coding problems.
- Identify and correct common function errors such as missing returns or argument mismatches.
|
Materials Needed:
- Projector or interactive whiteboard
- Computer lab with Python IDE (e.g., IDLE, VS Code)
- Printed handout of function syntax and example code
- Worksheet with practice questions
- Access to an online Python interpreter (optional)
|
Introduction:
Begin with a quick discussion of how everyday apps (maps, calculators) rely on reusable blocks of code. Review students’ prior knowledge of variables and simple statements, then pose the success criteria: by the end of the lesson they will be able to write, call, and debug a function in Python.
|
Lesson Structure:
- Do‑now (5'): Write a one‑line Python expression to calculate the area of a circle; share answers.
- Mini‑lecture (10'): Introduce function concepts, terminology, and flowchart diagram.
- Guided demonstration (15'): Define
circle_area(radius), run it, and discuss parameters and return value.
- Pair activity (15'): Students create
max_of_three(a,b,c) on the worksheet, test with sample inputs, and receive teacher feedback.
- Error‑spotting (10'): Review common mistakes; students debug a faulty function example.
- Exit ticket (5'): Write a correct function definition for temperature conversion and note one error to avoid.
|
Conclusion:
Recap the four key steps of defining and using a function and highlight how proper scope and return statements improve code reliability. Collect exit tickets as a quick retrieval check, and assign homework: students must write a function that converts Fahrenheit to Celsius and include at least one test case.
|