On Python 3.x, the string.replace() is deprecated . What is the better approach for doing this?
In 2.x, You can use str.replace()
>>> 'Hello world'.replace('world', 'Guido')'Hello Guido'
>>> 'Hello world'.replace('world', 'Guido')
Are you looking for a good python tutorial? Join the python course fast and gain more knowledge in python.
To know more about this you can have a look at the following video tutorial:-