string.replace (old, new, count)
old - old substring you want to replace.
new - new substring which would replace the old substring.
count - the number of times you want to replace the old substring with the new substring. ( Optional )
It returns a copy of the string in which all occurrences of the substring have been replaced with another substring.
Below is the code that demonstrates replace () :
Geeks for Geeks Geeks Geeks Geeks Python.Engineering for Python.Engineering Python.Engineering geeks geeks