dict = {1:[1,1,1], 2:[2,2,2]}
mylist = []
print dict
for key, value in dict.iteritems():
mylist.append(value)
for item in mylist:
a = item[0]+ item[1]
item.append(a)
print dict
the result of printing the dict before the operation is
{1: [1, 1, 1], 2: [2, 2, 2]}
While doing it after the iteritems
{1: [1, 1, 1, 2], 2: [2, 2, 2, 4]}
Why does the dict get modified?