replace () in python to replace a substring