Individual characters of strings are not assignable
suggest changefoo = "bar"
foo[0] = "c" # Error
That assignment raises TypeError: 'str' object does not support item assignment. The string object cannot be changed after it is created. The name foo can still be bound to a different string.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents