From the course: Advanced Python

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Advanced collections overview

Advanced collections overview - Python Tutorial

From the course: Advanced Python

Start my 1-month free trial

Advanced collections overview

- [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 data types, and how they build on the basic types to help solve different kinds of programming problems. So 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 are 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 they're created because they're mutable. And finally is the…

Contents