你可以使用 Python 的字符串方法 replace()
来实现这个功能。
代码如下:
s ="We are happy."
s = s.replace(" ", "")
print(s)
输出:
We are happy.
你可以使用 Python 的字符串方法 replace()
来实现这个功能。
代码如下:
s ="We are happy."
s = s.replace(" ", "")
print(s)
输出:
We are happy.