#去掉空格 strip() 方法能用于删除开始或结尾的字符
s = ’ hello world \n’
print(s.strip())
print(s)
t = ‘-----hello=====’
print(t.strip("-"))
#处理中间的空格
s = ’ hello world \n’
print(s.replace(" “,”"))
#去掉空格 strip() 方法能用于删除开始或结尾的字符
s = ’ hello world \n’
print(s.strip())
print(s)
t = ‘-----hello=====’
print(t.strip("-"))
#处理中间的空格
s = ’ hello world \n’
print(s.replace(" “,”"))