Expert Python Programming(Third Edition)
上QQ阅读APP看书,第一时间看更新

Containers

Python provides a good selection of built-in data containers that allow you to efficiently solve many problems if you choose them wisely. Types that you should already know of are those that have dedicated literals:

  • Lists
  • Tuples
  • Dictionaries
  • Sets

Python is, of course, not limited to these four containers, and it extends the list of possible choices through its standard library. In many cases, solutions to some problems may be as simple as making a good choice for the data structure to hold your data. This part of the book aims to ease such decisions by providing deeper insight of the possible options.