Answer:
(b)Tb = Ta[:3]
(c)Tc = Ta[-3:]
(d)Td = Tb + Tc
Explanation:
In order to generate random number in python, we need to first import random() function from random module
This function will generate a float number between 0 and 1, to make it between 1 and 15, we add 1 to the multiplication between the random number and the range differences
(a)
from random import random()
L = []
for i in range(10):
L.append(1 + round(random()*14))
Ta = tuple(L)
(b) To copy the first 3 elements of tuple Ta, we simply go from : to 3
Tb = Ta[:3]
(c) To copy the last 3 elements of tuple Ta, we simply go from -3 to :
Tc = Ta[-3:]
(d) To concatenate the 2 tuples, we simply add them up
Td = Tb + Tc