Chapter 13

Collecting All Sorts of Data

In This Chapter

arrow Defining a collection

arrow Using tuples

arrow Using dictionaries

arrow Developing stacks using lists

arrow Using the queue module

arrow Using the deque module

People collect all sorts of things. The CDs stacked near your entertainment center, the plates that are part of a series, baseball cards, and even the pens from every restaurant you’ve ever visited are all collections. The collections you encounter when you write applications are the same as the collections in the real world. A collection is simply a grouping of like items in one place and usually organized into some easily understood form.

remember.eps This chapter is about collections of various sorts. The central idea behind every collection is to create an environment in which the collection is properly managed ...

Get Beginning Programming with Python For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.