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 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.