Suppose this string:
The fox jumped over the log.
Turning into:
string = 'This is a string full of spaces and taps' string = string.split(' ') while '' in string: string.remove('') string = ' '.join(string) print(string)
Results:
This is a string full of spaces and taps