2(viii)
What will be the output of the following Python code?
t = (1, 2, 3) t = t + (4, 5) print(t)
Show SolutionHide Solution↓
(1, 2, 3, 4, 5)
The tuple t = (1, 2, 3) is created. The + operator concatenates (joins) two tuples. Here, the tuple (4, 5) is joined to t, forming a new tuple (1, 2, 3, 4, 5), which is stored back in t.