Add to Chrome
✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Consider a nested list data = [[1,2],[3,4]]. What happens when you write data[1][1] = 10?
data = [[1,2],[3,4]]
data[1][1] = 10
The entire inner list [3,4] is replaced by 10.
[3,4]
10
The element at row 1, column 1 becomes 10, modifying the original structure.
A TypeError occurs because nested lists are immutable.
TypeError
The assignment creates a new copy of the list without modifying the original.
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!