Lists and Tuples

Learning Objectives

By the end of this chapter, you will be able to:

  • Create and access lists in Python
  • Describe the various methods that are available in lists, and use them in your Python programs
  • Create and access tuples in Python
  • Identify the differences between tuples and lists
  • Implement the various built-in methods that are available with tuples

This lesson introduces lists and tuples in Python. We also look at the various list and tuple methods.

Introduction

A list is a data structure that holds ordered collections of related data. Lists are known as arrays in other programming languages, like Java, C, and C++. Python lists, however, are more flexible and powerful than the traditional arrays of other languages. ...

Get Python Fundamentals now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.