题解 | #消除牛牛不喜欢的空格#
消除牛牛不喜欢的空格
https://www.nowcoder.com/practice/f2baf7ccbc8b4bd2afde03baeab2edd5
import sys import re #使用正则表达式来实现 #原题不需要处理字符串中间空格 #re.sub(pattern, repl, string, count=0, flags=0) sentence = input() #sentence = re.sub(r'\s+',' ',sentence) print(sentence.strip())