'str' object does not support item assignment

jimbo1qaz jimmyli1528 at gmail.com
Sun Sep 23 14:31:41 EDT 2012


spots[y][x]=mark fails with a "'str' object does not support item assignment" error,even though:
>>> a=[["a"]]
>>> a[0][0]="b"
and:
>>> a=[["a"]]
>>> a[0][0]=1000000
both work.
Spots is a nested list created as a copy of another list.



More information about the Python-list mailing list