It is like a list with all comma separated elements enclosed in a pair of parenthesis.
It is an immutable list. A Tuple can not be changed in any way once it is created.
>>> t = (“Hello”, 10, “world”, 20) >>> t (‘Hello’, 10, ‘world’, 20)
Like a list, all its elements are ordered. First element starts at index 0.
Negative indices count from the end of the tuple, just like a list
Slicing also works for tuple same as it works for list.
(10, ‘world’) # creates a new tuple
Unlike list, they have no in-built methods. So you cannot add, remove, index elements in a tuple.
Thus, they are truly immutable in a way that lets you write create write-protect data.