Python Programming for the Absolute Beginner, 3rd Edition

Download CD Content

Overview

Tuples are a great way to work with sequences of any type, but their immutability can be limiting. Fortunately, another sequence type, called lists, do everything that tuples can, plus more. That's because lists are mutable. Elements can be added or removed from a list. You can even sort or reverse an entire list. You'll also be introduced to another type, dictionaries. Whereas lists work with sequences of information, dictionaries work with pairs of data. Dictionaries, like their real-life counterparts, let you look up one value with another. Specifically in this chapter, you'll learn to do the following:

Категории