Learn how to remove extra spaces from a string using regex, string splitting, a fixed point, and itertools.groupby.
itertools.groupby
If there is a 50% chance something will go wrong, then 9 times out of 10 it will.