将字符串 a = " welcome to my world "首尾空格去掉
a = " welcome to my world "
print(a.strip())
# 去掉结尾处指定的!
b = "welcome to my world!"
print(b.strip("!"))
将字符串 a = " welcome to my world "首尾空格去掉
a = " welcome to my world "
print(a.strip())
# 去掉结尾处指定的!
b = "welcome to my world!"
print(b.strip("!"))