>>> love = "python"
>>> love[0] = 'P'
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
love[0] = 'P'
TypeError: 'str' object does not support item assignment
有点类似c里面的字符串无法被改变一样 果然一法通 万法通....
>>> love = "python"
>>> love[0] = 'P'
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
love[0] = 'P'
TypeError: 'str' object does not support item assignment
有点类似c里面的字符串无法被改变一样 果然一法通 万法通....