From the course: Python Data Analysis

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Sequences: Lists, tuples, and the slicing syntax

Sequences: Lists, tuples, and the slicing syntax - Python Tutorial

From the course: Python Data Analysis

Start my 1-month free trial

Sequences: Lists, tuples, and the slicing syntax

- [Instructor] In this movie, we are going to review lists. They are the quintessential Python container. They provide a way to store an arbitrary number of Python objects such as strings, floating-point numbers, other lists, or any other object and to access them using a numerical index. In Python lists are denoted by brackets and their elements are separated by commas. The length of a list is obtained with len. Indexing, individual list elements can be accessed by index. Starting with zero for the first element and ending at the length of the list minus one. This convention of starting from zero comes from C, the language that inspired Python and that was used to write the standard Python interpreter known as CPython. For instance, the first nephew is Huey. We can also look for the last nephew and we can even look for a nephew beyond the end of the list which in this case will yield an error. We can also index from the end.…

Contents