'str' object does not support item assignment
MRAB
python at mrabarnett.plus.com
Sun Sep 23 14:47:38 EDT 2012
More information about the Python-list mailing list
Sun Sep 23 14:47:38 EDT 2012
- Previous message (by thread): 'str' object does not support item assignment
- Next message (by thread): 'str' object does not support item assignment
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 2012-09-23 19:31, jimbo1qaz wrote: > 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. > The error suggests that spots[y] is actually a string. Printing repr(spots) and repr(spots[y]) should tell you whether it is.
- Previous message (by thread): 'str' object does not support item assignment
- Next message (by thread): 'str' object does not support item assignment
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list