Home›Lesson Plans›Computer Science›Programming · Grade 10

Libraries & Modules

Tenth graders learn to reuse code with libraries and modules — collections of pre-written, tested code you can import instead of writing from scratch. Python’s standard library and installable packages save time and effort. They explore the ideas, then use a module.

Grade 10Libraries & Modules50 minutes1 class periodCSTA / ISTEExplicit teaching4 StandardsCSTA
Start the Lesson
Assign or share this lesson

Copy link works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment.

Lesson at a Glance

Everything you need before the bell rings

Learning Objectives

Students will be able to…

  • ✓Define a library.
  • ✓Use import.
  • ✓Know the standard library.
  • ✓Reuse code.
Essential Question

Why reinvent the wheel when you can reuse code others wrote?

0
Lesson Phases
0
Vocabulary Terms
0
Standards Aligned
0
Interactive Task
Explore · Interactive

Libraries & Modules

Project this and tap each. Have students explore libraries and modules.

📚 Explore libraries & modules — tap eachTry it

The Lesson · Explicit teaching

50 minutes, five moves

Tap any phase to open the teacher moves and student actions.

1

Hook — Don’t Reinvent It

5 min

Need a random number or a square root — do you really code that yourself?

👩‍🏫 Teacher Moves

  • Pose the question.
  • Share ideas.
  • Set the goal.

🎒 Student Actions

  • Think.
  • Share.
  • Get ready.
2

Use — Libraries

12 min

Students learn.

👩‍🏫 Teacher Moves

  • Send students to Libraries & Modules.
  • Tap each idea.
  • Note import to reuse.

🎒 Student Actions

  • Tap each.
  • Say.
  • Note it.
3

Modify — Use One

13 min

Students practice.

👩‍🏫 Teacher Moves

  • import random.
  • Use random.randint().
  • Try a math function.

🎒 Student Actions

  • Import.
  • Use.
  • Try.
4

Create — Create

15 min

Students apply.

👩‍🏫 Teacher Moves

  • Pick a module for a task.
  • Use one of its functions.
  • Explain why it helped.

🎒 Student Actions

  • Pick.
  • Use.
  • Explain.
5

Reflect — Reflect

5 min

Students close.

👩‍🏫 Teacher Moves

  • What is a library?
  • What does import do?
  • Complete the exit ticket.

🎒 Student Actions

  • Say it.
  • Say it.
  • Complete the exit ticket.
Standards Alignment

Built to the standards you report on

Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students.

CSTA
3A-AP-16

Incorporate existing code and libraries.

CSTA
3B-AP-22

Modify and remix using libraries.

CSTA
3A-AP-17

Test programs that use modules.

ISTE
5c

Build on existing computational work.

Differentiation

One lesson, every learner

Multilingual Learners

ELL / EMERGING READERS
  • Module example cards.
  • Frame: "import lets me use ___."
  • Demo a module live.

Support & Access

IEP / 504
  • Use import random only.
  • Use one function.
  • Use a template.

Stretch & Extend

GIFTED / EARLY FINISHERS
  • Explore 3 standard modules.
  • Install a package with pip.
  • Read module documentation.
Materials

What to gather

  • 📽️Screen / board
  • 📚Module cards
  • 💻Libraries & Modules
  • 💻Python
  • 📓Notebooks
  • 🎫Exit-ticket slips
Vocabulary

Key terms — hover for a quick definition

libraryreusable collections of codemodulea file of reusable codeimportbring in a modulestandard librarymodules built into Pythonpackagean installable librarypipthe tool to install packagesfunctiona reusable block of codereuseuse existing code again
Evaluate

Exit Ticket

Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students.

QUESTION 1
What is a library?
A collection of pre-written code you can reuse.
QUESTION 2
What does import do?
Brings a module’s code into your program.
QUESTION 3
Why use libraries?
They save time and give you tested code.

Reflect: libraries & modules.

Have students use a module function in a small program. A printable module sheet is in the CS library.

Study · Flashcards

Study the key terms

Tap a card to flip it, then rate whether you knew it. Built from this lesson’s vocabulary.

🃏 Libraries & ModulesFlip
Card 1
Term
Tap to flip →
Meaning
0

Nice work!

Practice · Quiz

Check your understanding

A quick self-check with instant feedback, drawn from this lesson’s key terms.

📝 Libraries & ModulesQuiz
Score: 0
1 / 6
Question 1
0%

Nice work!

Practice · Worksheet

Printable worksheet

A print-and-go review sheet with a built-in answer key. Tap “Show answer key” to reveal answers, or print the clean version for students.

🖨️ Libraries & ModulesPrint
Name: ________________________
Date: ____________

Part A · Write the word that matches each meaning

Word bank: function, import, library, module, package, pip, reuse, standard library
  1. an installable library
  2. modules built into Python
  3. a file of reusable code
  4. a reusable block of code
  5. the tool to install packages
  6. bring in a module
  7. reusable collections of code
  8. use existing code again

Part B · Show what you learned

  1. What is a library?
  2. What does import do?
  3. Why use libraries?
Answer key — Part A: 1) package · 2) standard library · 3) module · 4) function · 5) pip · 6) import · 7) library · 8) reuse
Part B: 1) A collection of pre-written code you can reuse. 2) Brings a module’s code into your program. 3) They save time and give you tested code.