Tuples are immutable types. Look at the commands below:
t = (1, 2, [3,4])
t[2] += [5,6]
t == (1, 2, [3, 4, 5, 6]) # True
When I try to perform the second action, I will catch an exception
TypeError: 'tuple' object does not support item assignment
But why the result in line 3 is True?
Created at: 2018/08/18 13:56; Updated at: 2018/08/22 04:29
The question is resolved.