In [1]:
t = (0, 1, 2)

In [2]:
print(t)


(0, 1, 2)

In [3]:
print(type(t))


<class 'tuple'>

In [4]:
print(t[0])


0

In [5]:
print(t[:2])


(0, 1)

In [6]:
# t[0] = 100
# TypeError: 'tuple' object does not support item assignment

In [7]:
# t.append(100)
# AttributeError: 'tuple' object has no attribute 'append'

In [8]:
t_add = t + (3, 4, 5)

In [9]:
print(t_add)


(0, 1, 2, 3, 4, 5)

In [10]:
print(t)


(0, 1, 2)

In [11]:
# print(t + [3, 4, 5])
# TypeError: can only concatenate tuple (not "list") to tuple

In [12]:
t_add_one = t + (3,)

In [13]:
print(t_add_one)


(0, 1, 2, 3)

In [14]:
l = list(t)

In [15]:
print(l)


[0, 1, 2]

In [16]:
print(type(l))


<class 'list'>

In [17]:
l.insert(2, 100)

In [18]:
print(l)


[0, 1, 100, 2]

In [19]:
t_insert = tuple(l)

In [20]:
print(t_insert)


(0, 1, 100, 2)

In [21]:
print(type(t_insert))


<class 'tuple'>

In [22]:
l = list(t)
l[1] = 100
t_change = tuple(l)

In [23]:
print(t_change)


(0, 100, 2)

In [24]:
l = list(t)
l.remove(1)
t_remove = tuple(l)

In [25]:
print(t_remove)


(0, 2)