CBSE Class 11 Computer Science Question 15 of 34

Tuples — Question 20

Back to all questions
20
Question

Question 3(d)

Carefully read the given code fragments and figure out the errors that the code may produce.

t1 = (3,)  
t2 = (4, 5, 6)  
t3 = t1 + t2  
print (t3)
Answer
Output
(3, 4, 5, 6) 
Explanation

t1 is a single element tuple since comma is added after the element 3, so it can be easily concatenated with other tuple. Hence, the code executes successfully without giving any errors.

Get the Bright Tutorials app Stuck on a question? Ask Bright Buddy — your AI tutor — for step-by-step help in the app.