Answer to Question #248577 in Python for Holik

Question #248577
Remove excess spaces from the given text, ie leave only one of several spaces
1
Expert's answer
2021-10-08T07:15:03-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS