get rid of all spaces and punctuation python code example Example: python remove spaces from string >>> " ".join(s.split()) 'Hello World From Pankaj Hi There'