CBSE Class 11 Computer Science Question 64 of 114

Tuples — Question 1

Back to all questions
1
Question

Question 1(a)

Find the output generated by following code fragments :

plane = ("Passengers", "Luggage")     
plane[1] = "Snakes"
Answer
Output
TypeError: 'tuple' object does not support item assignment
Explanation

Since tuples are immutable, tuple object does not support item assignment.