Write a Python3 program to demonstrate the use of replace() method


Topic: Write a Python3 program to demonstrate the use of replace() method

Solution

string = "geeks for geeks geeks geeks geeks"
print(string.replace("geeks", "Geeks")) 
print(string.replace("geeks", "GeeksforGeeks", 3)) 



List all Python Programs