CBSE Class 11 Computer Science Question 84 of 114

Tuples — Question 21

Back to all questions
21
Question

Question 3(e)

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

t2	= (4, 5, 6)
t3	= (6, 7)
print(t3 - t2)
Answer
Output
TypeError: unsupported operand type(s) for -: 'tuple' and 'tuple'   
Explanation

Arithmetic operations are not defined in tuples. Hence we can't remove items in a tuple.