I’m Learning Python (part 5)
String Is Immutable?
Last time I told you to try to change a specified character, you must have failed if you tried:
>>> s = ‘c’
The error you’d get is:
TypeError: ‘str’ object does not support item assignment
This means that strings are immutable, so are core-types, numbers and tuples, they can’t be changed, while lists and dictionaries can be changed freely.
Continue reading “I’m Learning Python (part 5)”