使用python字符串的项目分配的最佳/正确方法是什么?
即s = "ABCDEFGH" s[1] = 'a' s[-1]='b'?
s = "ABCDEFGH"
s[1] = 'a'
s[-1]='b'
正常方式将抛出: 'str' object does not support item assignment
'str' object does not support item assignment
python string
python ×1
string ×1