Python の文字列はイミュータブル(部分的変更は不可能)
Python の文字列はリストに近いですが、インデックスを使って部分的に変更することはできません。
s = "hello"
s[0] = "A"
# 'str' object does not support item assignment
この性質をイミュータブルといいます。文字列を置換すると新しい文字列ができます。
s = "hello"
t = s.replace("h", "AAA")
print(s) # hello
print(t) # AAAello
文字列 s は変わっていません。