ABSTRACT

It is remarkable how often we list or enumerate information. Lists help shoppers remember what to buy; checklists are essential for pilots going through complicated procedures on takeoff and landing; businesses continuously scan lists of sales and production figures; scientists analyze lists of experimental data looking for patterns. Python has the list data type, but that is only the starting point toward automating the many things people routinely do with lists. Learning how to manipulate data in lists is the gateway to mastering more sophisticated structures of information: databases built of tables, scientific matrix operations, and search engine statistics. This chapter reviews useful methods and functions for working with lists. Python has a special syntax for generating new lists from existing lists, which is quite powerful and interesting.