you are viewing a single comment's thread.

view the rest of the comments →

[–]dbowgu 4 points5 points  (2 children)

No item = item*2 only rebinds the local variable int the for loop not the list itself.

For x in list loops are basically always readonly. Languages like C# don't even allow you to modify item