In this lesson
- It starts with a question. Ana starts with an empty set called visitors. She adds "Mere", then "Jone", then "Mere" again. How many items does the set hold?
- The idea you will find. A set keeps one of each and answers “is it here?” straight away. — Six names went in and three stayed, because a set has no room for a repeat. It keeps no order and no counts — only whether a value is present. Choose it when that is the only question, such as “has this ticket been used?” or “how many different customers came?”
- How you learn it. By doing: counters, sorting, a slider.
- Length. 6 short steps. Progress saves on this phone.
Part of Python: Lists & Dictionaries
Choosing how to store data so the thing you do most often is the thing that is easy.