Вы можете использовать re
модуль:
import re
test_text="Python is the best"
output = re.sub(r'(\s){2,}', r'\1', test_text)
print(output)
Печать:
Python is the best
Редактировать (без повторного модуля):
test_text="Python is the best"
print(test_text.split())
Печать:
['Python', 'is', 'the', 'best']
Редактировать 2:
#to join it to one string:
print(' '.join(test_text.split()))
Печать:
Python is the best