From the course: Advanced Python: Working With Data
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Overview of collection classes - Python Tutorial
From the course: Advanced Python: Working With Data
Overview of collection classes
- [Instructor] Python ships with a basic set of data types for working with collections of data and you've probably already used some or all of these in your work at some point. In this chapter, we're going to learn about some of the more specialized and useful collection types and how they build on the basic collection classes to help solve different kinds of programming problems. As a quick refresher, recall that Python has four basic collection data types. There's the list, which is a sequence of data types and is declared using square brackets with each data item separated by a comma. A close relative of lists are tuples, which are defined with parentheses and are also comma-separated. However, lists can be changed once they are created because they're mutable, whereas tuples are not. Next is the set, which is an unordered collection of distinct values defined using curly braces and like lists, sets can be changed once…