CHAPTER 7
Lists
Objectives
- To describe why lists are useful in programming (§7.1).
- To learn how to create lists (§7.2).
- To explore common operations for sequences (§7.2.1).
- To use the len, min, max, sum, and random.shuffle functions with a list (§7.2.2).
- To access list elements by using indexed variables (§7.2.3).
- To obtain a sublist from a larger list by using the slicing operator [start : end : step] (§7.2.4).
- To use the + (concatenation), * (repetition), and in/not in operators on lists (§7.2.5).
- To traverse elements in a list using a for loop (§7.2.6).
- To compare the contents of two lists by using comparison operators (§7.2.7).
- To create lists by using list comprehension (§7.2.8).
- To invoke a list’s append, count, extend, index,
Get Introduction to Python Programming and Data Structures, 3rd Edition by Pearson 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.