Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Use built-in functions and library routines
Learning Objective/s:
  • Describe the purpose and typical examples of built‑in functions and library routines.
  • Explain key differences in availability, namespace usage, and performance.
  • Apply built‑in functions and selected standard library modules (e.g., math, random) to solve programming problems.
  • Demonstrate correct import syntax and best‑practice conventions for using library routines.
  • Evaluate when to choose a built‑in function versus a library routine in exam‑style scenarios.
Materials Needed:
  • Projector and screen
  • Whiteboard and markers
  • Laptops with a Python IDE installed
  • Printed handout of common built‑in functions and library module reference
  • Sample code files (math and random examples)
  • Worksheet with practice exercises
  • Internet access for documentation lookup
Introduction:

Begin with a quick poll: “Which functions do you use every day when coding?” Connect this to prior lessons on variables and basic functions. Explain that today’s success criteria are to identify, import, and correctly use both built‑in functions and library routines.

Lesson Structure:
  1. Do‑Now (5') – Students label built‑in vs library functions in a short code snippet.
  2. Mini‑lecture (10') – Define built‑in functions and library routines; show comparison table.
  3. Guided Demo (12') – Import math (use sqrt, pi) and random (generate randint); discuss import styles.
  4. Pair Programming (15') – Write a program that reads numbers, calculates the mean using sum() and len(), then extend it to select a random element using random.choice.
  5. Class Discussion (8') – Review best practices: explicit imports, avoiding import *, handling exceptions.
  6. Exit Ticket (5') – Each student writes one rule for deciding between a built‑in function and a library routine.
Conclusion:

Recap the key distinctions and best‑practice guidelines discussed today. Collect exit tickets to gauge understanding, and assign homework: create a short script that uses at least two different standard library modules to solve a real‑world problem.