Run
mystring = 'welcome to python examples' correctedstring = " ".join(mystring.split()) print(correctedstring)
Output