Lesson 1 of 0
In Progress

Unit 3 – Teachers Guide

Unit 3 ยท Teacher's Guide | Knowledge Pillars ยท Code Quest
๐Ÿ“š Teacher's Guide Code Quest ยท Coding Fundamentals

Unit 3 ยท Algorithms, Flowcharts & Sorting

Your day-to-day companion for delivering Unit 3 โ€” pacing, standards, lesson plans, misconceptions, differentiation, and a Python error appendix. Unit 3 is where students stop staring at blank screens and start planning before coding. Once they internalize "algorithm first, code second," every project that follows runs smoother.

๐Ÿ“‹ 5 Lessons + Capstone
โฑ๏ธ 6โ€“8 class periods
๐ŸŽ“ Florida Course #9009200

๐Ÿ‘‹ Welcome โ€” How to Use This Guide

This Teacher's Guide is your day-to-day companion for delivering Unit 3 of the Code Quest curriculum. It picks up after Unit 2 and assumes students are comfortable with everything from Units 1 & 2 โ€” variables, data types, operators, if/else, for loops, while loops, lists (read-only), and the 3-step debugging mindset. It's designed for new and experienced CS teachers alike โ€” no programming background required to use it effectively. Every lesson plan stands on its own; if a substitute teacher takes over for a day, they should be able to pick up the next lesson and run it.

What this guide contains

  • A pacing guide showing how Unit 3 maps to roughly 6โ€“8 class periods, with two-day extensions available for the trickier lessons (Bubble Sort and the capstone).
  • A standards & exam crosswalk showing exactly which Florida CTE standards and Coding Fundamentals exam objectives each lesson addresses. Unit 3 is the home of standards 07.02 (algorithms) and 07.06 (pseudocode).
  • A unit vocabulary glossary with all 14 key terms students will encounter in Unit 3 โ€” most of them brand new conceptual vocabulary (algorithm, flowchart, decision diamond, factorial, etc.).
  • Five detailed lesson plans (one per lesson), each using the same 7-section format you saw in Units 1 & 2.
  • An appendix with the most common Python errors students will see in Unit 3, focused on the new tools (.append() and sorted()) and lingering Unit 1โ€“2 carryovers.

How each lesson plan is structured

Every lesson plan in this guide uses the same 7-section format so you can find what you need quickly:

  • At-a-Glance โ€” objective, time, materials, vocabulary, and a quick-reference standards box
  • Lesson Flow โ€” a suggested 45-minute breakdown: warm-up, instruction, guided practice, lab, exit ticket
  • Watch For โ€” the 2โ€“4 most common student misconceptions, with how to address each in real time
  • Differentiation โ€” what to do for early finishers and what to do for struggling students
  • Discussion Prompts โ€” questions to spark whole-class conversation
  • Real-World Connections โ€” how to answer the inevitable "why does this matter?" question
  • Lesson-Specific Vocabulary โ€” terms introduced or reinforced in that lesson

How to read this in conjunction with the student lessons

Each Code Quest lesson is a self-contained HTML page that students work through at their own pace. This guide doesn't replace those lessons โ€” it equips you to teach alongside them. The expected workflow:

  • Before class: read this lesson plan (5โ€“10 min) and skim the student HTML lesson, paying special attention to interactive widgets (the Algorithm Builder, the Path Tracer, the Bubble Sort Visualizer, the Factorial Calculator)
  • During class: follow the lesson flow; the student HTML is the textbook + lab
  • After class: grade the Knowledge Checks and labs against this guide's expectations
๐Ÿ’ก Unit 3 is where conceptual thinking takes the lead. Lessons 1 (algorithms) and 2 (flowcharts) introduce abstract design skills BEFORE more code. Some students who breezed through Units 1โ€“2 will hit their first wall here because Unit 3 isn't about typing โ€” it's about thinking on paper. Lean into that. Whiteboards and printed flowchart shapes matter more this unit than at any prior point. The capstone is the lightest project of the year so far (it's mostly a Unit 2 callback with two new tools); the heavy lift is the planning vocabulary that comes before it.

๐Ÿ—บ๏ธ Unit 3 Overview

The big picture

Unit 3 introduces the most important shift in students' programming maturity โ€” plan before you code. Students learn what an algorithm is, how to write one in plain English, how to draw one as a flowchart, then trace through Bubble Sort (their first non-trivial algorithm) and explore factorials (their first taste of mathematical algorithm scaling). The capstone upgrades the Mad Libs game with two new Python tools โ€” .append() for list-building and sorted() for ordering โ€” applied through the algorithm-first mindset.

What students learn

  • Define an algorithm and apply the three rules every algorithm must follow: precise, ordered, finite
  • Write algorithms in plain English (informal pseudocode) before translating to Python
  • Read and draw flowcharts using the four standard shapes โ€” oval (terminator), parallelogram (input/output), rectangle (process), diamond (decision)
  • Follow flowcharts with loops by tracing the arrow path back to a previous decision
  • Trace Bubble Sort step by step โ€” comparing adjacent pairs and swapping until the largest values "bubble" to the end
  • Distinguish between writing a sort algorithm and using Python's built-in sorted() โ€” and explain why both matter
  • Define a factorial (n!), compute small factorials, and connect factorial growth to nested loops
  • Recognize that factorials grow surprisingly fast (10! > 3 million; 20! > 2 quintillion) โ€” the foundation of "Big O" thinking later
  • Use Python's list = [], list.append(item), and sorted(list) to collect and order data across loop iterations
  • Apply the "plan first, code second" mindset to a complete project (Mad Libs 3.0)

Prerequisites

Units 1 & 2. Students must be comfortable with: variables, data types, operators, if/elif/else, input(), f-strings, for loops with range(), while loops, list iteration (read-only), and the 3-step debugging mindset. Unit 3 doesn't introduce many new Python keywords โ€” its work is conceptual.

What comes next

Unit 4 introduces functions and a deeper formal SDLC (the same SDLC students glimpsed in Lesson 2.5). Functions let students name the algorithms they wrote in Unit 3 and reuse them. The "plan first" mindset students build here becomes the discipline that makes Unit 4's modular code clean rather than spaghetti.

Materials you'll need

  • Computers with web browser access (one per student, or pairs)
  • Knowledge Pillars CodeSkills Lab access
  • Projector or large screen โ€” Unit 3's interactive widgets (Algorithm Builder, Path Tracer, Bubble Sort Visualizer, Factorial Calculator) are designed for whole-class projection
  • Whiteboard with multiple colors โ€” used heavily in Lessons 1, 2, and 3 for live algorithm/flowchart drawing and Bubble Sort traces
  • Paper and pencils โ€” Unit 3 is the most paper-heavy unit so far. Students draw flowcharts on paper before drawing them digitally.
  • Optional: printed flowchart shape reference cards (one per student) โ€” tape to desk for Lessons 2 & 5
  • Optional: 5-10 sticky notes per student for the kinesthetic Bubble Sort activity in Lesson 3
๐ŸŽฏ Course alignment. Unit 3 is the home of Florida CTE standards 07.02 (algorithms), 07.06 (pseudocode), and the conceptual side of 05.06 (more than one algorithm) & 05.07 (implement an algorithm). The lessons all carry the "๐ŸŽฏ Objective 3" tag โ€” algorithm understanding and design โ€” which is the central exam objective for the unit. See the Standards Crosswalk below for full lesson-by-lesson detail.

โฑ๏ธ Pacing Guide

Unit 3 is designed to fit in 6โ€“8 class periods of approximately 45 minutes each. Lessons are individually shorter than Unit 2's (no 50-min lesson, no 2-day capstone) โ€” but the conceptual density is higher, especially in Lessons 2 and 3. Adjust based on how comfortably your students handled Unit 2 loops.

Recommended pacing โ€” 7-day plan

DayLessonFocusHomework
Day 1L1: AlgorithmsWhat an algorithm is. Three rules. Algorithm Builder. Lab 3.1A in class.Finish Lab 3.1B (write an everyday algorithm)
Day 2L2: FlowchartsFour shapes. Reading flowcharts. Path Tracer. Shape Match. Lab 3.2A.Finish Lab 3.2B (draw a flowchart on paper)
Day 3L3: Bubble Sort (pt 1)The idea. Visualizer. Trace Pass 1 on the whiteboard.Read Section 4 (Bubble Sort vs sorted())
Day 4L3: Bubble Sort (pt 2)Predict the Result. sorted(). Lab 3.3A. Knowledge check.Read L4 Sections 1โ€“2 (factorials)
Day 5L4: FactorialsDefinition. Growth pattern. Loop connection. Factorial Calculator. Lab 3.4A.Plan Mad Libs 3.0 algorithm on paper
Day 6L5: Mad Libs 3.0 CapstoneAlgorithm review. Live walkthrough of starter. Build with .append() and sorted().Continue building at home
Day 7L5: Mad Libs 3.0 CapstoneTest. Polish. Reflection. Showcase. Submit.โ€”

Compressed 6-day pacing

If you need to compress: combine Day 3 and Day 4 (cover all of Bubble Sort in one class). This works for stronger groups but rushes Bubble Sort tracing โ€” students who don't trace at least one full pass on paper rarely internalize how the algorithm works. Recommended only if your students breezed through Unit 2 loops + lists.

Extended 8-day pacing

If you have a shorter class period (30 min) or want deeper coverage: split Lesson 2 (flowcharts) across two days. Day 2 covers shapes + reading flowcharts; Day 3 has students draw their own flowcharts on paper for 3โ€“4 different problems. Drawing is what locks the concept in โ€” most teachers wish they'd budgeted more time here.

โฑ๏ธ Where the time usually goes. Lesson 2 (flowcharts) consistently runs longer than the 45-minute slot โ€” drawing takes time, and there's no shortcut. Lesson 3 (Bubble Sort) is the conceptual peak of the unit; spend the time you save in Lesson 4 (factorials, often quick) on extra Bubble Sort tracing if needed. Lesson 5 (Mad Libs 3.0) is the lightest project of the year โ€” it's a Unit 2 callback with two new tools, intentionally easier than the Unit 2 capstone so the conceptual lessons can take the spotlight.

Suggested grading weights for Unit 3

ComponentWeightNotes
Lesson Knowledge Checks (ร—4)20%3 questions each, completed in-platform
Lab Exercises (ร—7)30%Mix of paper-based (algorithm/flowchart drawing) and CodeSkills Lab
Mad Libs 3.0 Final Project30%Capstone โ€” see 100-pt rubric in Lesson 5 plan
Class participation20%Whiteboard work, peer flowchart review, kinesthetic Bubble Sort, reflection writing

Note: Participation is weighted heavier in Unit 3 than other units because so much of the unit is collaborative and on-paper. The Mad Libs 3.0 capstone is weighted slightly less than Unit 2's because it's a smaller code lift โ€” the heavy work is in the four conceptual lessons.

๐ŸŽ“ Standards & Exam Crosswalk

This crosswalk shows exactly which Florida CTE standards and Coding Fundamentals exam objectives each lesson addresses. Use this for admin reviews, IEP documentation, or to prove alignment when adopting the curriculum. Unit 3's primary "new" standards are 07.02 (algorithms) and 07.06 (pseudocode). Every lesson in the unit carries the "๐ŸŽฏ Objective 3" tag โ€” algorithm understanding and design โ€” which is the central exam objective.

Florida CTE Standards โ€” Course #9009200

Standards from the Florida Department of Education Coding Fundamentals curriculum framework that Unit 3 addresses:

StandardDescriptionLessons
01.01Use specialized computer coding software to solve problems.L3, L4, L5 (CodeSkills Lab)
01.02Demonstrate proficiency using specialized computer software (e.g., Python).L3, L4, L5
02.02Explain the components of programming languages.L3, L4, L5
05.06Recognize that more than one algorithm can solve a given problem.L3 (Bubble Sort vs sorted()), L5
05.07Create a program that implements an algorithm to achieve a given goal.L5 (Mad Libs 3.0)
07.01Describe the structure of a simple program; explain why sequencing is important.L1, L2, L5
07.02Explain what an algorithm is; identify and describe common algorithms (sorting, searching).L1, L2, L3, L4, L5 โ€” primary unit standard
07.03Describe iterative programming structures (loops); explain logic of loop conditions.L4 (loop connection), L5 (loop reuse)
07.06Use pseudocode and/or flowcharts to describe a process.L1 (pseudocode), L2 (flowcharts), L5 โ€” primary unit standard
07.07Troubleshoot and debug errors in code.L5 (carryover habit)

Coding Fundamentals Exam Objectives

Exam objectives that Unit 3 prepares students for. Objective 3 โ€” algorithm understanding โ€” is the unit's primary objective; every lesson tags it explicitly.

ObjTitleCoverage in Unit 3Lessons
1Core programming conceptsReinforced through capstoneL5
2Analyze and predict code behaviorHeavy โ€” Bubble Sort tracing, factorial growth predictionL3, L4
3Algorithm understanding & designFull coverage โ€” primary objective for the entire unitL1, L2, L3, L4, L5
4Write and debug simple programsReinforced โ€” capstone applies algorithm-first habitL5

Lesson-by-lesson alignment

LessonFlorida StandardsExam Objectives
L1: What is an Algorithm?07.01, 07.02, 07.063 (primary)
L2: Flowcharts07.01, 07.02, 07.063 (primary)
L3: Bubble Sort01.01, 01.02, 02.02, 05.06, 07.022, 3 (primary)
L4: Factorials01.01, 01.02, 02.02, 07.02, 07.032, 3 (primary)
L5: Mad Libs 3.001.01, 01.02, 05.06, 05.07, 07.01, 07.02, 07.03, 07.06, 07.071, 3 (primary), 4
๐Ÿ“‹ What's not in Unit 3. These standards are NOT addressed in Unit 3 and appear in later units: 03.x (file types) โ€” Unit 6 ยท 04.03 (sorting/filtering data sets) โ€” Unit 10 ยท 06.03 (iterative SDLC debugging) โ€” Unit 4 ยท 07.04 (selection structures, deeper dive) โ€” already covered in Units 1 & 2 ยท 07.05 (variable types deeper dive) โ€” Unit 4 ยท 07.08 (databases) โ€” Unit 10. Note: students APPLY 07.04 and 07.05 throughout Unit 3 even though those standards are not its focus.

๐Ÿ“– Unit 3 Vocabulary Glossary

All key terms students will encounter in Unit 3. Most are conceptual rather than syntactic โ€” Unit 3 introduces few new Python keywords but many new ideas. The "Intro" column shows the lesson where the term first appears. Each lesson plan also includes its own focused vocabulary list.

TermDefinitionExampleIntro
AlgorithmA clear, ordered, finite set of steps that solves a problem. Anyone (or any computer) following the steps gets the same result."Brush teeth" recipe; making a sandwichL1
PseudocodePlain-English steps that look a little like code. The bridge between an algorithm and real Python."FOR each item: IF X > Y, swap"L1
Plan-First MindsetThe discipline of writing the algorithm BEFORE typing any code. Saves time and catches bugs early."Plan it, then code it"L1
FlowchartA picture of an algorithm โ€” boxes connected by arrows showing the path from Start to End.(Diagram with shapes and arrows)L2
Terminator (Oval)The flowchart shape for Start and End points. Always at the very top and very bottom."START" ovalL2
Process (Rectangle)The flowchart shape for an action or step โ€” anything that DOES something."Set count = 0"L2
Input/Output (Parallelogram)The flowchart shape for taking input from the user or printing output. The slanted box."Read score" / "Print result"L2
Decision (Diamond)The flowchart shape for a Yes/No question. Two arrows leave it โ€” one for True, one for False."Score >= 70?" with Yes/No pathsL2
Sorting AlgorithmAn algorithm that puts a list in order (numerical, alphabetical, etc.). There are many; Bubble Sort is one.Bubble Sort, Merge Sort, Quick SortL3
Bubble SortA sorting algorithm that compares adjacent pairs and swaps them if out of order. Largest values "bubble up" to the end after each pass.[3,1,2] โ†’ [1,2,3]L3
SwapExchanging the values of two variables. The basic operation inside Bubble Sort.a, b = b, aL3
PassOne full sweep through the list during a sort. Bubble Sort needs Nโ€“1 passes for a list of N items in the worst case.Pass 1, Pass 2, ...L3
Factorial (n!)The product of all positive integers from 1 to n. Written with an exclamation mark.5! = 5ร—4ร—3ร—2ร—1 = 120L4
List []An ordered collection that can hold many values. Created with square brackets. Empty list: [].animals = []L5
.append()List method that adds one item to the end of the list. Modifies the list in place.animals.append("dog")L5
sorted()Built-in Python function that returns a new sorted version of a list. Doesn't change the original.sorted([3,1,2]) โ†’ [1,2,3]L5
๐Ÿ“– Teaching tip. 16 terms but only 3 of them require typing in Python (list = [], .append(), sorted()). The other 13 are conceptual โ€” students should be able to explain them out loud, not just recognize them on a quiz. Use weekly "explain it back" partner exercises: one student picks a term, the other has to explain it without using the term itself. The four flowchart shapes especially benefit from this drill.

๐Ÿ“‹ Lesson 1 ยท What is an Algorithm?

Lesson 1 ยท What is an Algorithm?

Lesson Plan

At-a-Glance

Objective
Students will define what an algorithm is, identify whether a set of steps satisfies the three rules (precise, ordered, finite), and write a simple algorithm in plain English before translating it to Python.
Time
45 minutes
Materials
Computer with browser, CodeSkills Lab access, projector, whiteboard, paper for student algorithms
Vocabulary
Algorithm, Pseudocode, Plan-First Mindset
FL Standards
07.01, 07.02, 07.06
Exam Obj.
Objective 3 (primary)

Lesson Flow (45 minutes)

๐Ÿ”ฅ Warm-Up (5 min)

  • Project this: "Write down the steps for making a peanut butter and jelly sandwich. Be SPECIFIC โ€” pretend the reader has never seen one before."
  • Take 2โ€“3 examples. Pick the most ambiguous one ("put the peanut butter on the bread" โ€” but how? With what?) and play "robot teacher": follow it literally and miss obvious things. The class laughs. Reveal: that's exactly what computers do โ€” they follow exactly what you wrote, not what you meant.

๐ŸŽค Direct Instruction (12 min)

  • Open Lesson 3.1 on the projector. Walk through Section 1 ("Algorithms Are Everywhere"). Note that students follow algorithms daily โ€” recipes, morning routines, game rules โ€” they just don't call them that.
  • Walk through Section 2 ("The Three Rules"). On the whiteboard write: PRECISE ยท ORDERED ยท FINITE. Explain each: precise = no ambiguity; ordered = step 1 before step 2; finite = eventually stops (no infinite loops here either).
  • Walk through Section 3 ("Writing in Plain English"). Project the side-by-side example โ€” algorithm in plain English on the left, Python translation on the right. Trace the connection: "ASK for number" becomes input(), "IF" becomes if, etc.
  • Emphasize: plan first, code second. This is the Unit's defining mindset and the entire reason this lesson comes before the others.

๐Ÿค Guided Practice (10 min)

  • Use the Algorithm Rule Checker in Section 4. Project a few examples; for each, take a class vote: which rule does this break? Then reveal.
  • On the whiteboard, write a vague algorithm together: "How to find the biggest number in a list." Take suggestions; rewrite each to be more precise. Show the path from "look at all the numbers and pick the biggest" โ†’ "Set largest to first number; for each number: if number > largest, set largest = number; print largest."

๐Ÿ’ป Independent Lab (13 min)

  • Lab 3.1A โ€” "Write the Algorithm": students pick one of three problems (largest of 3 numbers, even or odd, password checker) and write the algorithm on PAPER first. Then translate to Python in CodeSkills Lab.
  • Use the Algorithm Builder widget in Section 5 if students need scaffolding.
  • Circulate. The most common student move: skip the paper step and dive into Python. Stop them, hand them the paper, make them do it. The discipline is the lesson.

๐Ÿšช Exit Ticket (5 min)

  • On paper: "Write a 4-step algorithm for setting an alarm on your phone. Make sure it satisfies all three rules โ€” precise, ordered, finite."
  • Look for: clear step numbers, no ambiguity ("press the button" โ†’ which button?), a clear stopping point. If a student writes 1 step, push back. If they write 15, also push back โ€” they over-described.

โš ๏ธ Watch For โ€” Common Misconceptions

1. "An algorithm is just code."
What you'll see: Students write Python directly when asked for "the algorithm." They skip the plain-English step entirely.
How to address: Reframe: an algorithm is the plan; code is the translation. A recipe is an algorithm. A dance routine is an algorithm. Code is just one way to record an algorithm. To prove it: write the same algorithm in 3 forms โ€” English, flowchart (preview Lesson 2), Python โ€” all three describe the same algorithm.
2. "Vague descriptions count as algorithms."
What you'll see: A "step" reads "make the sandwich" or "do the math." No detail; assumes shared knowledge.
How to address: Apply the precise rule โ€” could a 5-year-old (or a robot) follow this step exactly? If not, break it down further. Use the PB&J warm-up callback: "make the sandwich" is too vague; "spread peanut butter on one slice using a knife" is precise.
3. "Algorithms are only for math."
What you'll see: Students think "algorithm" only applies to numerical computation.
How to address: Give non-math examples: a recipe, a dance routine, the steps to log into a website, brushing teeth. Algorithms are step-by-step procedures for ANY task. The Lesson 1 student examples lean intentionally non-mathematical for this reason.

๐ŸŽฏ Differentiation

For early finishers
Challenge them to write the algorithm for a more complex problem: "Find the second-largest number in a list" or "Reverse a list without using .reverse()." Bonus: have them swap with a partner and try to find an edge case that breaks the algorithm โ€” the start of testing as a habit.
For struggling students
Stay on the everyday-algorithm exercise (PB&J, alarm, walking to school). Skip the Python translation entirely for class time โ€” that's homework. The win: they wrote a precise, ordered, finite set of steps in plain English. That IS the lesson.

๐Ÿ’ฌ Discussion Prompts

  • If you wrote the same algorithm in English and your friend wrote the same algorithm in their own English, would they be the same algorithm? (Yes, if the steps describe the same procedure. Algorithms are language-independent. Two recipes for chocolate chip cookies in English and Spanish are the same algorithm.)
  • Why is "be precise" so much harder than it sounds? (Humans share a ton of context implicitly โ€” we assume the reader knows what a "knife" or "bread" is. Computers share NO context. Precision means stripping out that assumption.)
  • If we always write the algorithm first in English, why don't we just do all our coding in English? (English is too ambiguous for a computer. Python is unambiguous. The English plan keeps US clear; the Python translation keeps the COMPUTER clear.)

๐ŸŒ Real-World Connections

  • Recipes. The world's oldest written algorithms. A precisely-written recipe = an algorithm a cook can execute.
  • Search engines. Google's PageRank algorithm decides which page to show first. Different algorithm = different ranking. Whoever owns the algorithm owns the internet.
  • GPS navigation. "Find shortest route" is an algorithm (Dijkstra's). Different algorithms produce different routes โ€” Waze vs Google Maps don't agree because they use different ones.
  • Social media feeds. Why do you see what you see? An algorithm. The plan-first mindset of Unit 3 is what every engineer at TikTok, Instagram, and YouTube uses every day.

๐Ÿ“– Lesson-Specific Vocabulary

Algorithm โ€” A clear, ordered, finite set of steps that solves a problem.
Pseudocode โ€” Plain-English steps that look a little like code. The bridge between an algorithm and real Python.
Plan-First Mindset โ€” The discipline of writing the algorithm BEFORE typing any code.
โ†‘ Back to top

๐Ÿ—บ๏ธ Lesson 2 ยท Flowcharts โ€” Drawing Your Plan

Lesson 2 ยท Flowcharts

Lesson Plan

At-a-Glance

Objective
Students will identify the four standard flowchart shapes (oval, parallelogram, rectangle, diamond), trace the path through a flowchart from Start to End, recognize loops in flowchart form, and draw a flowchart for a simple algorithm.
Time
45 minutes (often runs 50 โ€” drawing takes time; consider extending)
Materials
Computer with browser, projector, whiteboard, paper + pencils for every student, optional printed shape reference cards
Vocabulary
Flowchart, Terminator (Oval), Process (Rectangle), Input/Output (Parallelogram), Decision (Diamond)
FL Standards
07.01, 07.02, 07.06
Exam Obj.
Objective 3 (primary)

Lesson Flow (45 minutes)

๐Ÿ”ฅ Warm-Up (5 min)

  • Project a road map (any city). Ask: "If I'm here and want to get to here, how do I tell you the route?" Take answers โ€” they'll naturally describe turns and decisions.
  • Reveal: a flowchart is a map for an algorithm. Boxes are the locations; arrows are the roads; diamonds are the intersections where you decide left or right.

๐ŸŽค Direct Instruction (12 min)

  • Open Lesson 3.2 on the projector. Walk through Section 1 ("The Four Flowchart Shapes"). On the whiteboard, draw all four: oval, parallelogram, rectangle, diamond. Color-code each.
  • Drill the meanings using a chant: OVAL = Start/End. PARALLELOGRAM = Input/Output. RECTANGLE = Process. DIAMOND = Decision. Repeat as a class twice.
  • Walk through Section 2 ("A Complete Flowchart"). Trace the grade-checker flowchart together โ€” start at the oval, follow each arrow, watch the diamond split into Yes/No paths.
  • Walk through Section 3 ("Flowcharts with Loops"). Show how a loop is just an arrow that goes BACK to a previous decision. The "loop" comes from the arrow path, not a special shape.

๐Ÿค Guided Practice (10 min)

  • Use the Interactive Path Tracer in Section 4. Pick scenarios; have students predict the path before clicking.
  • Use the Shape Match Challenge in Section 5 โ€” quick-fire identification. Run it as a class round; project results.
  • On the whiteboard, draw an empty flowchart skeleton (just shapes, no labels). Have students suggest labels for each shape to make it a "log into a website" flowchart.

๐Ÿ’ป Independent Lab (13 min)

  • Lab 3.2A โ€” "Read the Flowchart": students follow a flowchart and trace which path they take for given inputs. Pure path-following.
  • Lab 3.2B โ€” "Draw the Flowchart": students draw a flowchart for a simple algorithm on PAPER (not in software). Topics: largest of 2 numbers, even/odd, login retry. Pencil + paper, with the four shapes used at least once each.
  • Circulate. Most common issue: students draw a rectangle where a diamond belongs (any time the program "decides," it's a diamond). Second most common: forgetting Start and End ovals.

๐Ÿšช Exit Ticket (5 min)

  • Project a flowchart with the shapes left blank (just outlines and labels). Students label each shape with its name. Five shapes total โ€” Start, Read input, If/decision, Process, End.
  • Look for 100% correct on the diamond โ€” that's the most-tested shape on the exam. If a student misidentifies a diamond, they need extra practice before Lesson 3.

โš ๏ธ Watch For โ€” Common Misconceptions

1. "Use a rectangle for everything."
What you'll see: Students draw a flowchart with all rectangles โ€” even decisions, inputs, and start/end points.
How to address: Drill the four-shape rule. Every step must be classified: Is it an action (rectangle), a question (diamond), an input/output (parallelogram), or a start/end (oval)? Use the printed reference card. The shapes carry meaning โ€” using the wrong one is like writing in the wrong language.
2. "Decision diamonds have one arrow out."
What you'll see: A diamond labeled "Score >= 70?" but only one arrow leaving it. Students forget that decisions branch.
How to address: Drill: every diamond must have two arrows leaving โ€” one for Yes (or True) and one for No (False). Both must be labeled. If a student draws only one, ask: "What happens if the answer is No?" The missing branch reveals itself.
3. "Loops need a special shape."
What you'll see: Students try to invent a "loop shape" or get stuck because they don't know how to draw a loop.
How to address: Reveal the secret: a loop is just an arrow that points BACKWARD to a previous box. No special shape. The loop happens because the path takes you back through the same boxes again. Show the example from Section 3 of the lesson.
4. "Forgot the End oval."
What you'll see: A student's flowchart trails off into nothing. No End oval. Sometimes they forget Start too.
How to address: Before drawing anything else, draw both ovals first โ€” Start at the top, End at the bottom. THEN connect them with the algorithm. This is similar to Unit 2's counter-pattern habit (initialize before, update inside, read after) โ€” train the structural moves before the content moves.

๐ŸŽฏ Differentiation

For early finishers
Have them draw a flowchart for the Mad Libs 2.0 game from Unit 2. This is hard โ€” there's a nested loop (the for inside the while), at least one decision diamond, and several inputs and outputs. It also previews the Mad Libs 3.0 capstone planning.
For struggling students
Stay on Lab 3.2A (read-only path tracing). Skip drawing for class time. The win: identify the four shapes and follow arrows correctly. Drawing can be revisited as homework with a printed shape template they trace into.

๐Ÿ’ฌ Discussion Prompts

  • What's the advantage of a flowchart over plain-English pseudocode? (Visual layout makes branches and loops obvious at a glance. Easier to spot a missing case (the "no" branch from a diamond) when it's a picture.)
  • What's the disadvantage? (Slower to draw than to type. Hard to edit. Doesn't scale to large algorithms โ€” a flowchart for a 1000-line program is unreadable.)
  • Where would a professional engineer choose flowchart over pseudocode? (System diagrams, team communication, requirements docs. Mostly NOT for actual code design โ€” that's pseudocode's territory. Flowcharts shine when communicating to non-coders.)

๐ŸŒ Real-World Connections

  • UX flow diagrams. Designers draw flowcharts to plan how users navigate apps โ€” every "Sign Up" screen and "Forgot Password" branch is a diamond.
  • Manufacturing. Factory assembly lines have process flowcharts on the wall for every workstation. Quality control checkpoints are diamonds.
  • Medical decision trees. Doctors and triage nurses follow flowcharts to decide which test to order next. Lives literally depend on the diamonds.
  • Customer support scripts. "Have you tried turning it off and on again?" โ†’ diamond โ†’ "Did that fix it?" โ†’ diamond โ†’ ... is a flowchart powering call centers.

๐Ÿ“– Lesson-Specific Vocabulary

Flowchart โ€” A picture of an algorithm: shapes connected by arrows showing the path from Start to End.
Terminator (Oval) โ€” The Start or End point. Always at the top and bottom of the diagram.
Process (Rectangle) โ€” An action or step โ€” anything that DOES something.
Input/Output (Parallelogram) โ€” Reading input from the user or printing output. The slanted box.
Decision (Diamond) โ€” A Yes/No question. Always has TWO arrows out: one for True, one for False.
โ†‘ Back to top

๐Ÿซง Lesson 3 ยท Bubble Sort โ€” How Computers Sort Lists

Lesson 3 ยท Bubble Sort

Lesson Plan

At-a-Glance

Objective
Students will explain how Bubble Sort works (compare adjacent pairs, swap if out of order, largest "bubbles" to the end), trace one full pass on paper, and explain why Python's sorted() is preferred in production while still understanding what's happening underneath.
Time
45 minutes (often split into 2 days for deeper tracing)
Materials
Computer, projector, whiteboard, optional: 5โ€“8 sticky notes per student (or numbered index cards) for kinesthetic Bubble Sort
Vocabulary
Sorting Algorithm, Bubble Sort, Swap, Pass
FL Standards
01.01, 01.02, 02.02, 05.06, 07.02
Exam Obj.
Objectives 2, 3 (primary)

Lesson Flow (45 minutes)

๐Ÿ”ฅ Warm-Up โ€” Kinesthetic Sort (8 min)

  • Hand out sticky notes (or index cards) with random numbers 1โ€“9 to 5โ€“6 student volunteers. Have them stand in a line in the order they got the numbers.
  • Tell them: "Compare yourself to your right neighbor. If your number is bigger, swap places. Then everyone do it again. Keep going until no one swaps."
  • The class watches the largest number "bubble" to the right end after Pass 1, then the second-largest after Pass 2, etc. Reveal: that's Bubble Sort.
  • This kinesthetic intro is the single most powerful teaching move in Unit 3. Don't skip it even if you feel time-pressed.

๐ŸŽค Direct Instruction (10 min)

  • Open Lesson 3.3 on the projector. Walk through Section 1 ("How Bubble Sort Works"). Connect to the kinesthetic warm-up: each pair-comparison is one step.
  • Use the Interactive Bubble Sort Visualizer in Section 2. Click Step slowly, ask the class to predict each swap before clicking.
  • Walk through Section 3 ("Tracing Pass 1"). On the whiteboard, draw a 5-element list and trace Pass 1 by hand. Mark every comparison and every swap. Show that the largest element ends up at the end after one pass.
  • Define swap precisely: exchanging two values. In Python: a, b = b, a. Show why a temporary variable is used in many languages but Python doesn't need one.

๐Ÿค Guided Practice (10 min)

  • Use the Predict the Result challenges in Section 4 โ€” give a starting list, predict the state after Pass 1.
  • Walk through Section 5 ("Bubble Sort vs Python's sorted()"). Project both side by side. The big point: knowing Bubble Sort teaches you HOW computers sort; using sorted() is what you ACTUALLY do in real code. Both matter.

๐Ÿ’ป Independent Lab (12 min)

  • Lab 3.3A โ€” "Trace and Predict": students trace 2 full passes of a Bubble Sort on a 6-element list, on paper, with a trace table.
  • Lab 3.3B โ€” "Use sorted()": in CodeSkills Lab, students use sorted() to sort lists of numbers and strings. They confirm that the original list isn't changed (sorted returns a new list).
  • Circulate the paper trace closely. The most common error: students swap on every comparison, even when the order is already right. The rule is "swap ONLY if left > right."

๐Ÿšช Exit Ticket (5 min)

  • On paper: "Show the state of [4, 1, 3, 2] after one full pass of Bubble Sort."
  • Answer: [1, 3, 2, 4]. Walk: compare 4&1 โ†’ swap โ†’ [1,4,3,2]. Compare 4&3 โ†’ swap โ†’ [1,3,4,2]. Compare 4&2 โ†’ swap โ†’ [1,3,2,4]. The 4 is now at the end. Note: 3 and 2 are still out of order โ€” that's Pass 2's job.

โš ๏ธ Watch For โ€” Common Misconceptions

1. "One pass sorts the whole list."
What you'll see: A student writes the final sorted list as the result of Pass 1.
How to address: Reinforce: each pass only places ONE element correctly (the next-largest). A list of N items needs Nโ€“1 passes in the worst case. Use the kinesthetic warm-up callback: "remember how only the biggest number got to the end after the first round?"
2. "Swap means just write the right number."
What you'll see: A student traces a swap by writing the bigger number on the right but forgets to also move the smaller number to the left. Result: a list with a duplicate.
How to address: Drill: a swap moves BOTH values. The pair (4, 1) becomes (1, 4) โ€” both positions change. On the whiteboard, use two-arrow notation: 4 โ‡† 1.
3. "Always swap on every comparison."
What you'll see: A student swaps even when the pair is already in order, breaking the sort.
How to address: The rule: swap ONLY if left > right. If left <= right, leave them. Test with a sorted list โ€” Bubble Sort should make ZERO swaps if the list is already sorted (this is the "no swaps in a pass = done" optimization).
4. "Why learn Bubble Sort if Python has sorted()?"
What you'll see: A motivational pushback โ€” they want to skip to sorted().
How to address: Reframe: knowing Bubble Sort isn't about USING it (no professional uses it for production data โ€” it's slow). It's about understanding HOW sorting works at all, recognizing patterns of comparison-and-swap, and being able to talk about algorithms in interviews. Bubble Sort is a teaching tool; sorted() is a professional tool. You need both.

๐ŸŽฏ Differentiation

For early finishers
Challenge: trace ALL passes of Bubble Sort on a 6-element list โ€” record the state after each pass. Then explain in 2 sentences why Bubble Sort gets faster as it goes (each pass only needs to scan the unsorted portion). Stretch: research Selection Sort and explain how it differs from Bubble Sort in one paragraph.
For struggling students
Stay on Pass 1 only. Use the kinesthetic warm-up as the lesson's anchor โ€” physically swap sticky notes on the desk. Use Lab 3.3B (just sorted()) instead of Lab 3.3A (the trace). The win: they can use Python's sorting, even if they can't yet trace Bubble Sort by hand.

๐Ÿ’ฌ Discussion Prompts

  • How would you sort a deck of cards by hand? Is your method like Bubble Sort, or different? (Most people use Insertion Sort intuitively โ€” pick a card, insert it where it belongs. This previews Unit 9 algorithms โ€” students re-encounter sorting choices.)
  • If Bubble Sort is slow, why do textbooks teach it first? (It's the simplest sorting algorithm to understand and trace. Pedagogically, it's the perfect first sort.)
  • Could a person using Bubble Sort ever beat a person using a different algorithm? (For a list of 3 items, yes โ€” they're all about the same. For 1,000 items, no โ€” Bubble Sort scales terribly. The size of the data is what makes the algorithm choice matter.)

๐ŸŒ Real-World Connections

  • Sorting your phone's photos by date. The phone runs a sort algorithm โ€” almost certainly NOT Bubble Sort (it's too slow), but the same fundamental "compare and arrange" logic.
  • Spreadsheets. Click a column header to sort. Excel and Google Sheets use a hybrid sort algorithm called Timsort โ€” built on the same comparison principles you learned today.
  • Search rankings. Google returns results in a sorted order (most relevant first). The "score" of each page is sorted using a fast algorithm โ€” but the COMPARISON step is the same idea you saw in Bubble Sort.
  • Tournament brackets. Single-elimination tournaments are essentially a sorting algorithm โ€” comparisons (matches) reveal the "largest" (best) team.

๐Ÿ“– Lesson-Specific Vocabulary

Sorting Algorithm โ€” An algorithm that puts a list in order. Many exist; Bubble Sort is one of the simplest.
Bubble Sort โ€” Compare adjacent pairs, swap if out of order. Largest values bubble up to the end.
Swap โ€” Exchanging two values. The basic operation inside Bubble Sort. Python: a, b = b, a.
Pass โ€” One full sweep through the list. N items need up to Nโ€“1 passes to fully sort.
โ†‘ Back to top

๐Ÿ”ข Lesson 4 ยท Factorials โ€” Multiplying All the Way Down

Lesson 4 ยท Factorials

Lesson Plan

At-a-Glance

Objective
Students will define a factorial, compute small factorials by hand, recognize that factorials grow extremely fast, and write a Python loop that calculates n! for small n.
Time
45 minutes
Materials
Computer, CodeSkills Lab, projector, whiteboard, calculator (or Factorial Calculator widget)
Vocabulary
Factorial, n!
FL Standards
01.01, 01.02, 02.02, 07.02, 07.03
Exam Obj.
Objectives 2, 3 (primary)

Lesson Flow (45 minutes)

๐Ÿ”ฅ Warm-Up (5 min)

  • Ask: "How many ways can you arrange 3 books on a shelf?" Take guesses. Walk it: 3 choices for first, then 2 for second, then 1 for last โ†’ 3 ร— 2 ร— 1 = 6.
  • Ask: "Now 5 books?" Most will guess too low. The answer is 5 ร— 4 ร— 3 ร— 2 ร— 1 = 120. Reveal: "That's a factorial. Today we learn what they are and why they grow so fast."

๐ŸŽค Direct Instruction (10 min)

  • Open Lesson 3.4 on the projector. Walk through Section 1 ("What is a Factorial?"). Define: n! = n ร— (nโ€“1) ร— (nโ€“2) ร— ... ร— 2 ร— 1.
  • Walk through Section 2 ("The Factorial Table"). Project the table โ€” 1!=1, 2!=2, 3!=6, 4!=24, 5!=120, 10!=3,628,800, 20!>2 quintillion.
  • Walk through Section 3 ("How Fast Do Factorials Grow?"). Compare 10! (~3.6 million) to 2ยนโฐ (1024). Factorials grow MUCH faster than exponentials. This is the foundation for "Big O" thinking later in Unit 9.
  • Walk through Section 4 ("How Factorials Connect to Loops"). Show the for-loop pattern: result = 1; for i in range(1, n+1): result *= i. This is a Unit 2 callback โ€” a counter, but multiplying instead of adding.

๐Ÿค Guided Practice (8 min)

  • Use the Factorial Calculator in Section 5. Compute 7!, 8!, 12! together. Confirm by hand on the whiteboard for 7!.
  • Use the Factorial Challenges in Section 6 โ€” students try a few mentally before checking.
  • Project Section 7 ("Where Factorials Show Up") โ€” how many ways to seat 8 people, password permutations, route planning. Factorials are why password cracking is hard and routing is famously slow.

๐Ÿ’ป Independent Lab (15 min)

  • Lab 3.4A โ€” "Build the Factorial Function": in CodeSkills Lab, students write a for-loop that calculates n! for any n the user enters. Validate with input.
  • Lab 3.4B โ€” "Find the Tipping Point": students keep increasing n until the result is "too big to be useful" โ€” the discovery moment when 20! makes them say "whoa." Pure intuition-building exercise.
  • Circulate. The single most common bug: starting result = 0 instead of result = 1. Anything times 0 is 0, so the answer is always 0. Direct echo of the counter-pattern lesson from Unit 2.3 โ€” initialize to the right value.

๐Ÿšช Exit Ticket (5 min)

  • On paper: "Without a calculator, what is 6! ? Show your work."
  • Answer: 6 ร— 5 ร— 4 ร— 3 ร— 2 ร— 1 = 720. Look for the multiplication chain. If a student writes "720" with no work, push for the chain โ€” the process IS the lesson.

โš ๏ธ Watch For โ€” Common Misconceptions

1. "Factorials are addition."
What you'll see: A student writes 5! = 5+4+3+2+1 = 15.
How to address: Drill: factorial means MULTIPLY, not add. The exclamation mark doesn't mean "sum." Hand-trace 5! = 5 ร— 4 ร— 3 ร— 2 ร— 1 = 120 on the whiteboard. The 15 vs 120 contrast is dramatic; use it.
2. "Initialize result to 0."
What you'll see: The factorial loop returns 0 every time. The bug: result = 0 at the start; anything ร— 0 = 0 forever.
How to address: The rule for accumulator patterns: if you're MULTIPLYING, start at 1; if you're ADDING, start at 0. The starting value must be the "do nothing" identity for the operation. Direct callback to Unit 2.3 counter pattern.
3. "0! = 0."
What you'll see: Students assume 0! = 0 by analogy with 0 ร— anything.
How to address: Mathematicians DEFINE 0! = 1 (the empty product). Don't go too deep โ€” just state the rule: 0! = 1 by definition. (Reason: there's exactly 1 way to arrange 0 items โ€” the empty arrangement.) Most students accept this on authority; that's fine for grade 6โ€“8.

๐ŸŽฏ Differentiation

For early finishers
Challenge: write a Python program that prints the factorial table from 1! to 15! using a for-loop. Bonus: research and explain the connection between factorials and "permutations" โ€” why n! tells you how many ways to arrange n things in a row. Stretch: investigate why 70! is too big for a calculator (overflow) but Python handles it fine (arbitrary precision integers).
For struggling students
Skip Lab 3.4B. Stay on Lab 3.4A but limit n to โ‰ค 6 (so they can verify by hand). The win: understand that n! means "multiply down to 1" and write a working loop. The growth-rate insight is bonus.

๐Ÿ’ฌ Discussion Prompts

  • If a password is 8 characters and each character has 26 options, how many possible passwords? (26โธ โ‰ˆ 209 billion โ€” exponential, not factorial. Distinguish the two.)
  • If you're scheduling 10 students into 10 different time slots (each gets one slot), how many possible schedules? (10! = 3,628,800 โ€” that's why scheduling software is hard!)
  • Why does it matter for computer science that factorials grow so fast? (Some algorithms run in n! time. They're useless for n > ~12. Knowing factorial growth helps engineers spot doomed algorithms early. This is direct setup for Big O in Unit 9.)

๐ŸŒ Real-World Connections

  • Traveling salesman. Visit 10 cities and return home in the shortest order โ€” there are 10!/2 possible routes. For 20 cities, 20!/2 โ€” more atoms than in some galaxies. This is THE classic hard algorithm problem.
  • Password cracking. A 5-letter password (any 26 letters) has 26โต โ‰ˆ 12 million possibilities. A 5-letter password where every letter is unique has only 26 ร— 25 ร— 24 ร— 23 ร— 22 = 7.9 million. Permutations show up in security math.
  • Cryptography. The Enigma machine used in WWII produced ~159 quintillion possible settings โ€” a factorial-derived number. Cracking it required a different algorithm (and a person named Alan Turing).
  • Genetics. A 10-gene sequence can shuffle in 10! = 3.6 million ways. Bioinformatics is built on factorial counting.

๐Ÿ“– Lesson-Specific Vocabulary

Factorial (n!) โ€” The product of all positive integers from 1 to n. Example: 5! = 5 ร— 4 ร— 3 ร— 2 ร— 1 = 120.
Empty product โ€” The product of zero numbers, defined as 1. This is why 0! = 1.
โ†‘ Back to top

๐ŸŽฎ Lesson 5 ยท Mad Libs 3.0 โ€” Sorted Edition Capstone

Lesson 5 ยท Mad Libs 3.0 Capstone

Project Plan

At-a-Glance

Objective
Students will write a plain-English algorithm BEFORE coding, then upgrade Mad Libs 2.0 with two new tools โ€” .append() to collect entries across rounds and sorted() to display them alphabetically. They will demonstrate the algorithm-first mindset from Lesson 1 in a real project context.
Time
One to two class periods (45โ€“90 min) โ€” optional 2-day version mirrors Unit 2's capstone
Materials
Computer, CodeSkills Lab, projector, paper for algorithm planning
Vocabulary
List [], .append(), sorted(), plus all prior Unit 3 vocabulary
FL Standards
01.01, 01.02, 05.06, 05.07, 07.01, 07.02, 07.03, 07.06, 07.07
Exam Obj.
Objectives 1, 3 (primary), 4 โ€” comprehensive Unit 3 application
๐Ÿ’ก The lightest capstone of the year. Mad Libs 3.0 is intentionally a smaller code lift than Mad Libs 2.0 โ€” most of the structure is reused from Unit 2. The new tools (.append(), sorted()) are tiny additions. The pedagogical work this capstone does is enforcing the algorithm-first habit โ€” students MUST write 6 plain-English steps before coding. The discipline is the deliverable, not the code complexity.

Project Flow (45 min single-day version)

๐Ÿ”ฅ Warm-Up (5 min)

  • Project Mad Libs 2.0 (the version students built in Unit 2). Ask: "If we wanted to remember every animal players entered across all 3 rounds, how would we do it?" Steer toward "save them in a list."
  • Reveal: today we add two tiny tools โ€” .append() and sorted() โ€” that turn a one-shot list into a growing, then sorted, collection.

๐ŸŽค Direct Instruction โ€” Two New Tools (8 min)

  • Open Lesson 3.5 on the projector. Walk through "The Two New Tools" section.
  • Live-code .append(): animals = [] before, then animals.append("dog"), animals.append("cat"), print(animals). Output: ['dog', 'cat']. Note the empty-list start.
  • Live-code sorted(): print(sorted(animals)). Output: ['cat', 'dog']. Crucial point: sorted() returns a NEW list โ€” the original is unchanged.
  • Connect to Unit 2: animals = [] initialized BEFORE the loop, .append() INSIDE the loop, sorted() read AFTER. Same three-place pattern as Unit 2's counter โ€” but accumulating items instead of counting.

๐ŸŽฏ Algorithm First (10 min)

  • Distribute paper. Project the empty algorithm template:
    1. Create empty list before loop
    2. Loop runs 3 times
    3. Inside loop: collect inputs from player
    4. Inside loop: .append() animal to list
    5. Inside loop: tell the story
    6. After loop: print sorted list
  • Have students write THEIR version of the 6 steps in their own words. Walk around. No one opens CodeSkills Lab until their plan is on paper. This is the lesson.

๐Ÿ’ป Build (17 min)

  • Students copy the starter code into CodeSkills Lab. Their algorithm goes at the top as a comment block.
  • They fill in the missing pieces. The starter has the structure โ€” they add the story, the prompts, and the sorted output.
  • Circulate. The most common bug: animals = [] placed INSIDE the loop instead of before (resets each round, ends with only 1 animal). Echo of Unit 2.3 counter bug โ€” same shape, different content.

๐ŸŽ‰ Showcase & Submit (5 min)

  • Pick 2โ€“3 volunteers to run their Mad Libs 3.0 in front of the class. Class members supply the words.
  • The reveal at the end: the sorted list of all the animals players entered. Audible "ohh" when students realize they've built something with memory across rounds.
  • Submit via the in-platform checklist + reflection box.

Two-Day Pacing (90 min total)

If you have flexibility โ€” split as Day 1 (algorithm planning, build with help) and Day 2 (test, polish, showcase, submit). The flowchart bonus challenge from the lesson works well as a Day 1 stretch task. The Day 2 showcase tends to be more polished if students sleep on their work.

โš ๏ธ Watch For โ€” Common Project Pitfalls

1. The "skipped the algorithm" temptation.
What you'll see: A student opens CodeSkills Lab and starts coding immediately, no paper plan.
How to address: Stop them. Hand them paper. The algorithm-first habit is the single thing this entire unit exists to build. The capstone REQUIRES the 6-step plan to be in the code as a comment block โ€” it's the largest single rubric category.
2. The "list inside the loop" bug.
What you'll see: The final sorted list contains only 1 animal โ€” the one from round 3.
How to address: The bug: animals = [] is INSIDE the loop, so it resets every round. Move it BEFORE the loop. Direct callback to Unit 2.3 counter-init bug โ€” students should recognize the pattern.
3. ".append() expecting a return value."
What you'll see: A student writes animals = animals.append("dog") โ€” they expect .append() to return the new list.
How to address: .append() modifies the list in place and returns None. So animals becomes None โ€” and the next iteration crashes with AttributeError: 'NoneType' object has no attribute 'append'. The fix: just animals.append("dog") on its own line.
4. "sorted() changes the original."
What you'll see: A student calls sorted(animals) as a statement (not assigning the result) and expects animals to now be sorted. It isn't.
How to address: sorted() returns a NEW sorted list; doesn't modify the original. Either assign the result (sorted_animals = sorted(animals)) or print it directly (print(sorted(animals))). Distinguish from list.sort() which DOES modify in place โ€” but isn't taught here.

๐ŸŽฏ Differentiation

For students who finish early
Direct them to the bonus challenges from the lesson: Silver = sort two lists (animals AND adjectives). Gold = draw the complete flowchart for Mad Libs 3.0 on paper, attach as a photo. Platinum = deduplicate using set() โ€” research independently, demonstrate. Each adds +5 pts (max +20).
For struggling students
It's OK if their version only has the for loop with .append() and skips sorted(). They demonstrated the list-collection pattern. Add sorted() as a stretch the next class. Even better: have them work in a pair with a stronger student โ€” the algorithm-first habit transfers between students well during pair work.

๐Ÿ’ฌ Discussion Prompts

  • How is animals.append(x) like the counter pattern from Unit 2 (count += 1)? (Same three-place structure: initialize before the loop, update inside, read after. The difference: counter accumulates a number, list accumulates items.)
  • Why does sorted() return a NEW list instead of changing the original? (Functional design โ€” it's safer not to mutate inputs. Useful when you want both the original order and a sorted view.)
  • If you finished, would Mad Libs 4.0 (next year) be easier to plan because of what you learned today? (Reflection prompt โ€” the algorithm-first habit IS the transfer skill. Whatever Mad Libs 4.0 looks like, the plan-then-code approach is the same.)

๐ŸŒ Real-World Connections

  • Online shopping carts. Every "Add to Cart" button is .append() in disguise. The cart is a list; clicking adds an item; checkout sorts/groups before display.
  • Music playlists. Adding songs to a playlist is .append(). "Sort by artist" is sorted(). Building a playlist is the same pattern as Mad Libs 3.0.
  • Photo albums. Phone photos accumulate via .append(); "Sort by date taken" is sorted(). Modern apps run this every time you open the gallery.
  • Survey responses. Every form submission appends a row; admins view sorted results. The bones of every survey tool.

๐Ÿ“‹ Mad Libs 3.0 Project Rubric (100 points)

The student lesson uses a 13-item checklist; this guide adapts it into a 100-point rubric for grading consistency with Units 1 & 2. Share this rubric with students at the start of the project.

CategoryWhat to look forPts
Algorithm Plan (the headline category)6+ step plain-English algorithm written as a comment block at the top of the file. Steps are numbered, precise, ordered, and finite. The plan must clearly identify where the list is created, where .append() happens, and where sorted() happens.25
List + .append() Patternall_animals = [] created BEFORE the loop. .append(animal) called INSIDE the loop on each iteration.15
sorted() OutputAfter the loop, the program prints the list of animals in alphabetical order using sorted(). Output is clearly labeled.10
For Loop & Round StructureInner for loop runs 3 rounds. Round counter labels the rounds clearly for the player.10
If/Else Inside LoopConditional inside the for loop creates a different ending message based on a value (e.g., the number entered).10
Story OutputStory uses f-strings to plug in player words. Output is readable and fun.10
Comments & StyleHeader comment, inline comments per step, snake_case variable names, 4-space indentation. At least 5 inline comments.10
Works CorrectlyProgram runs end-to-end without errors. Plays all 3 rounds. Sorted list contains all 3 entered animals.10
TOTAL100

๐ŸŽ Stretch Goals (extra credit)

  • Silver โ€” sort TWO lists (animals AND adjectives) collected separately: +5 pts
  • Gold โ€” drawn flowchart of Mad Libs 3.0 on paper, photo attached: +5 pts
  • Platinum โ€” deduplication using set() or an if-check: +5 pts
  • 5 rounds instead of 3 (with all messages updated): +5 pts

Maximum stretch credit: +20 points. Document each stretch goal in a comment at the bottom of the file.

๐Ÿ“– Lesson-Specific Vocabulary

List [] โ€” An ordered collection that can hold many values. Created with square brackets. Empty list: [].
.append() โ€” Adds one item to the end of a list. Modifies the list in place. Example: animals.append("dog").
sorted() โ€” Built-in function. Returns a NEW sorted list. Doesn't modify the original.
โ†‘ Back to top

๐Ÿ› ๏ธ Appendix ยท Common Python Errors in Unit 3

This appendix lists the most common Python error messages students will see in Unit 3, focused on the new tools (.append(), sorted()) and the carryover errors from Units 1โ€“2 that resurface in the capstone. Unit 3 introduces relatively few new error types โ€” but the algorithm-first mindset means students should hit fewer errors overall.

ERRORAttributeError: 'list' object has no attribute 'apend'

What it usually means: Typo in .append(). Student wrote .apend() with one 'p'. Very common.

How to fix: Spell append with two 'p's: animals.append("dog"). Variants: .appned(), .appendix() โ€” all the same fix.

ERRORAttributeError: 'NoneType' object has no attribute 'append'

What it usually means: Student wrote animals = animals.append("dog") โ€” they assigned the return value of .append() back to animals. But .append() returns None, so now animals IS None. The next iteration's append crashes.

How to fix: Don't assign the result. Just call the method: animals.append("dog") on its own line. The list updates in place.

ERRORNameError: name 'sorted' is not defined (when student wrote 'sort')

What it usually means: Student wrote sort(animals) as a function. There's no top-level sort() function in Python โ€” it's sorted() with a 'd', or animals.sort() as a method.

How to fix: Use sorted(animals) if you want a new sorted list (this lesson's choice). Or animals.sort() if you want to sort in place. Don't mix the two.

SILENT(no error โ€” final list only has 1 item)

What it usually means: The empty list animals = [] is INSIDE the for loop. It resets to [] at the start of every iteration. By the end, the list only contains the last appended item.

How to fix: Move animals = [] BEFORE the loop. Echo of Unit 2.3's counter-initialization bug. The rule: anything that should accumulate across iterations is initialized BEFORE, updated INSIDE, read AFTER.

SILENT(factorial returns 0 for every input)

What it usually means: The factorial loop's accumulator is initialized to result = 0. Then result = result * i is always 0 (anything ร— 0 = 0).

How to fix: Initialize result = 1. The "do-nothing" identity for multiplication is 1, not 0. Same logic applied differently from Unit 2.3 counter (where 0 IS the right start because we ADD to it).

ERRORTypeError: '<' not supported between instances of 'int' and 'str'

What it usually means: A student tries to sorted() a list with mixed types (some numbers, some strings). Python can't compare them.

How to fix: Make sure the list contains only one type. If users enter numbers via input(), wrap with int() before appending so all entries are integers. Or keep all as strings.

CARRYOVERCarryover errors from Units 1 & 2

Watch list:

  • SyntaxError: expected ':' โ€” missing colon on for or if line. Same as Unit 1 & 2.
  • IndentationError โ€” typically in the capstone where loops + if/else nest. Three-level indentation rules from Unit 2.3 still apply.
  • NameError โ€” variable used before defined, or typo. Same as before.
  • TypeError: '>' not supported between instances of 'str' and 'int' โ€” student forgot to int()-wrap input. Same as Unit 1 quotes-trap.
  • Infinite loop (no error) โ€” if a student keeps Unit 2's while loop wrapper around the new code and forgets to update the loop variable. Use the 3-step debugging strategy.
๐Ÿ›Ÿ The algorithm-first mindset is the appendix's quiet co-author. Students who took the time to write their 6-step plan in Unit 3 hit fewer errors than students who didn't. When debugging, Unit 3 adds one prompt to the 3-step debugging strategy: "Does your code match your algorithm?" Often the bug is a step skipped, reordered, or misimplemented from the plan.
๐Ÿ“˜ Companion document. A Unit 3 Answer Key with Knowledge Check answers and lab solutions can be authored separately on request. The Teacher's Guide + Answer Key are designed to be used together.

โ€” End of Unit 3 Teacher's Guide โ€”

โ†‘ Back to top