How do I modify a string in place?

You can’t, because strings are immutable. Most string manipulation code in Python simply creates new strings instead of modifying the existing ones.

If you need a string-like object that can be modified in place, try converting the string to a list