Since the default action of split is to seperate by white space (any number or type of white space will do), the following one liner would do: >>> s='a b c d' >>> ' '.join(s.split()) 'a b c d' Rich