Ive tried using .replace() but when I use an index to define the character being replaced, it replaces all of the characters that are the same as the one being indexed as shown here:
string = "cool"
print(string.replace(string[1], "u"))
if returns:
"cuul"
But I just want the specific character which the index of string[1] to be replaced, for example, I want it to work as such:
string = "cool"
print(substitute(string[1],"u")
such that it prints:
"cuol"