2 ms·
>>> s = 'foobar' >>> s[1:2] = 'xxx' Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'str' object does not su
by DonHopkins 8y ago
>>> s = 'foobar'
>>> s[1:2] = 'xxx'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'str' object does not support item assignment
Dammit Python! Immutable strings.