I have
tuples = (('a',), ('b',), ('c',), ('d',))
I tried to update it with the following code.
for tup in tuples:
tup += (1,)
print tuples
I expected the result will be (('a',1), ('b',1), ('c',1), ('d',1))
. But it printed the same as the original value. Why?
When I inserted print tup
in the loop, I saw that tup
was updated.