strip() 方法用于移除字符串头尾指定的字符
例1
相关程序:
s = input().strip() print(s)
结果:
hello world
hello world
例2
相关程序:
s = input().strip() print(s)
结果:
hello world
hello world
strip() 方法用于移除字符串头尾指定的字符
例1
相关程序:
s = input().strip() print(s)
结果:
hello world
hello world
例2
相关程序:
s = input().strip() print(s)
结果:
hello world
hello world