9 Lists and Sets
Working with groups of related values is an essential part of many programs. For example, your program might manage lists of books, travel destinations, menu items, or tavern patrons’ tab balances. Collections allow you to conveniently work with those groups of values and pass them as arguments to functions.
You will see the most commonly used collection types in the next two chapters: List, Set, and Map. Like the other variable types you learned about in Chapter 2, lists, sets, and maps come in two distinct varieties: mutable and read-only. In this chapter, we will focus on lists and sets.
Your NyetHack hero has just embarked on a long journey to reach the town of Kronstadt. To wind down and meet some citizens ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access