5. Python Lists

Until you understand lists, you don’t know Python.

Along with text strings, lists are the most important example of an iterable in Python: a source of data you can always get “the next value” from (until you can’t). The biggest key to writing efficient, high-quality Python code is to understand the Python concept of lists.

This chapter explains how to do the following:

Image Use lists to sort information

Image Get selected subranges of data, called slices

Work efficiently with the Python for statement

The Python Way: The World Is Made of ...

Get Python Without Fear 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.