by @kodeazy

Replace a charcter in String in python.

Home » Python » Replace a charcter in String in python.
string = 'abceefg'
pos = 3
replaceable_character = 'd'
string = string[:pos] + replaceable_character + string[pos+1:]
print(string)

Output:

abcdefg