题解 | #消除牛牛不喜欢的空格#

消除牛牛不喜欢的空格

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())

全部评论

相关推荐

待现的未见之事:起码第一句要把自己的优势说出来吧。比如什么xx本27届学生,随时到岗....
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务