Question #248577

Remove excess spaces from the given text, ie leave only one of several spaces

Expert's answer

string = input('Enter string here: ')
import re
re.sub(' +', ' ', string)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS