5 Sequences: Lists and Tuples

Objectives

In this chapter you’ll:

  • Create and initialize lists and tuples.

  • Refer to elements of lists, tuples and strings.

  • Sort and search lists, and search tuples.

  • Pass lists and tuples to functions and methods.

  • Use list methods to perform common manipulations, such as searching for items, sorting a list, inserting items and removing items.

  • Use additional Python functional-style programming capabilities, including lambdas and the functional-style programming operations filter, map and reduce.

  • Use functional-style list comprehensions to create lists quickly and easily, and use generator expressions to generate values on demand.

  • Use two-dimensional lists.

  • Enhance your analysis and presentation skills with the Seaborn and Matplotlib visualization libraries.