import re s = 'The py language is a multimodel language.' print(re.sub('py','python',s))
str1.replace(oldstr,newstr)