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