CBSE Class 12 Computer Science Question 82 of 105

Python Revision Tour II — Question 9

Back to all questions
9
Question

Question 5(b)

Find the errors. State reasons.

t = [1, "a", 9.2]
t[0] = 6
Answer

There are no errors in this python code. Lists in python can contain elements of any type. As lists are mutable so t[0] = 6 is also valid.