When using a for loop in Python to iterate over items in a list, will changing item (below) change the corresponding item in items?
Well, it really depends on the items.
Take the following case:
class test():
pass
a = test()
a.value = 1
b = test()
b.value = 2
l = [a,b]
for item in l:
item.value += 1
for item in l:
print item.value
>>>
2
3
and in this case:
l2 = [1,2,3]
for item in l2:
item += 1
for item in l2:
print item
>>>
1
2
3
So as you can see, you need to understand the pointers as Martijn said.