Tuples and Dictionaries

In this lesson, we will learn about two important data structures in Python: tuples and dictionaries.

Tuples #

A tuple is very similar to a list, except its contents cannot be changed. In other words, a tuple is immutable. However, it can contain mutable elements like a list. These elements can be altered.

We can’t add or delete elements from them. Furthermore, it isn’t possible to append another tuple to an existing tuple.

The contents of a tuple are enclosed in parentheses, (). They are also ordered, and hence, follow the linear index notation.

Get hands-on with 1200+ tech skills courses.