课程: Advanced Python (2018)

今天就学习课程吧!

今天就开通帐号,24,600 门业界名师课程任您挑!

Advanced collections overview

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…

内容