>>> a =10>>> a[2]=5
Traceback (most recent call last):
File "<interactive input>", line 1,in<module>
TypeError:'int'object does not support item assignment
In [1]: a =2
In [2]: a[1]=3---------------------------------------------------------------------------
TypeError Traceback (most recent call last)<ipython-input-2-23f2cf2bdf70>in<module>---->1 a[1]=3
TypeError:'int'object does not support item assignment
Object is
int
, no item for assignment.错把
整型
当做列表了,然后对以列表的方式进行赋值了?就是如同下面这样?