What will be the output of the following Python code?

ICSE Class 10 Robotics & AI PYQ · 2026 Improvement · Section A

2(viii)1 Mark · 2026 · Section A · 2026 Improvement

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.

← Previous questionNext question →

Browse the free Robotics & AI sample bank