how to replace a certain string in certain position python code example Example: python str replace specifiek index s = s[:index] + newstring + s[index + 1:]