1>>> import re
2>>> re.sub(' +', ' ', 'The quick brown fox')
3'The quick brown fox'
1' hello world! '.strip()
2'hello world!'
3
4
5' hello world! '.lstrip()
6'hello world! '
7
8' hello world! '.rstrip()
9' hello world!'
1a = " yo! "
2b = a.strip() # this will remove the white spaces that are leading and trailing