What is the syntax to return a string with old values replaced with new values?

<string name>.replace(<old>, <new>, <max>)
#old - substring to be replaced
#new - substring that will replace old
#max - specifies the max numer of replacements, optional parameter
#examples
str='abababababab'

print(str.replace('b','a'))
print(str.replace('b','a', 4))
print(str.replace('b','a', 0))

#output
aaaaaaaaaaaa
aaaaaaaaabab
abababababab
Advertisements