RosettaCodeData/Task/Enforced-immutability/Python/enforced-immutability-1.py

8 lines
181 B
Python

>>> s = "Hello"
>>> s[0] = "h"
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
s[0] = "h"
TypeError: 'str' object does not support item assignment