Run
x = 'apple' ch = 'm' i = 3 output = x[:i] + ch + x[i:] print(output)
Output