Teach students to keep each value only once in Python with a set. Students pick a string, list, tuple or set for jobs at a library, make a set with set(), add names with .add() and ask with in. They print a count with len() and the items with sorted(), and they clean up a list of club tags that has repeats.
● Instant download · Lifetime access · Editable & print-ready
Short coding levels practice this lesson in CodeGrove, our code lab that runs in the browser. Students write the program, run it and check it, with no account and nothing to install. Use them with the lesson or as practice later.
See the levels→Students often use a list when a program needs each value only once, and then they count the same visitor twice. This lesson shows how a set drops repeats. It also teaches why a set has no positions and no fixed order, so students print a sorted copy.
The try-it on Day 1 and the quiz task on Day 2 run online in CodeGrove, our in-browser code lab, so students need a computer or tablet on those days. The Unique Visitors level practices making sets, adding names to them, asking with in, and printing a set's count and its sorted items. CodeGrove is free, with no accounts, sign-ins or installs.
Students pick a string, list, tuple or set for four jobs and explain two of their choices, on paper with computers closed.
Students add names to a set and see that a repeated name changes nothing. The count then shows each value once.
Students pick a string, list, tuple or set for four jobs. They explain two of their choices.
Every page is a print-ready PDF, and the Google Forms™ and Google Slides™ let you teach the same lesson in Google Classroom™.
Students write and run real Python in CodeGrove, our in-browser code lab, on a computer or tablet, with no accounts or installs.
Every day has its own answer key, and every written question has a sample answer and what to look for.
Each day's plan is timed activity by activity against real reading and writing speeds.
Reviews help me a lot, and they help other teachers pick the right resources for their classes. It takes about a minute.
Leave a reviewInstant download right after checkout: PowerPoint and Word files you can edit, print-ready PDFs, and links that copy the Google Forms™ and Google Slides™ into your Drive.
Yes. This lesson is part of the Unit 3 bundle and the complete Python Programming 2 course. Both cost less than buying the lessons one at a time.
No. It is a full-year, non-AP second course in Python for grades 9 to 12. For AP, see our AP Computer Science A and AP CSP courses.
Students know the loop patterns, len(), and how to write a function that returns a value.
Yes, on the CodeGrove days. Each student needs a computer or tablet that's online, and CodeGrove needs no account or install. The bell ringers, notes, exit tickets and quiz are on paper.
Every page is a print-ready PDF. The slides are an editable PowerPoint and the guided notes an editable Word file. The exit tickets and the quiz also come as Google Forms™, and the deck as Google Slides™.
Written for Florida's Intermediate Programming course (9007220). The skills map in the lesson shows which standards each day teaches.