Tuples in Python are immutable, they cannot be changed. Once an element is inside a tuple (1, 2, 3), it cannot be changed.
In [1]:
t = (1,2,3)
l = [1,2,3]
In [2]:
t
Out[2]:
In [3]:
l
Out[3]:
In [4]:
len(t)
Out[4]:
In [7]:
#can use slicing and indexing
t[2] # indexing
t[-1] # indexing
Out[7]:
In [8]:
t[0:] # slicing
Out[8]:
In [9]:
l[2]
Out[9]:
In [10]:
l[1:]
Out[10]:
In [11]:
l[0] = 'NEW'
In [13]:
l
Out[13]:
In [15]:
t[0] = 'NEW' #Point and case: cannot change data in a tuple.
In [ ]: