Show that a Python string cannot be changed in place, and how you build a modified version instead.
Python strings are immutable. Once a string object exists, you cannot change the characters inside it, and any attempt to do so raises a TypeError. Instead, you build a new string that holds the changed text and use that new string.
text = 'hello'
try:
text[0] = 'H'
except TypeError as error:
print('TypeError:', error)
upper = text.upper()
print(upper, text)
print(text.replace('l', 'L'))
print(text + ' world')
The error message tells you that the string object does not support item assignment. Every other line in the script works because each string method returns a brand new string instead of changing the original one. That is why the last print shows both values next to each other. The uppercase word is the new string, and the original word is still exactly as it was.
This is also the reason that you never see text[0] = used on a string in working code, and it is the reason that code which builds a long string inside a loop must collect the pieces in a list and join them at the end, instead of adding to the string again and again.
There is one internal detail worth knowing about. CPython keeps a small cache of one-character strings, so there are some implementation tricks around single characters. None of that is language behaviour that you should rely on in your own code.