...

/

Basic Tuple Operations

Basic Tuple Operations

Learn about the basic tuple operations in Python.

We'll cover the following...

Some basic tuple operations are given below.

Mutability

Unlike a list, a tuple is immutable, i.e., it cannot be modified.

Press + to interact
msg = ('Fall', 'In', 'Line')
msg[0] ='FALL' # error
msg[1:3] = ('Above', 'Mark') # error

Note: Since a tuple is immutable, operations like append(), remove(), and insert() do not work with a tuple.

Though a tuple itself is immutable, it can contain mutable objects like lists.

 ...