7 Working with Lists and Reading Data

When you need to work with multiple values, you can group them into a single variable by using a Python list. The list data type stores any number of items in collections you can manage and manipulate dynamically and efficiently. For example, you could create a list to store the titles of your favorite movies and use built-in methods to insert new favorites, reorder the rankings, or display only titles ranked between 30 and 40.

In this chapter, you’ll learn to create and manipulate lists, and then you’ll combine them with loops to access and perform actions with each item. In keeping with this book’s ...

Get Learn Python Visually now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.