先说一下strip()函数
描述:python strip()只能用于移除string 开头或结尾的charts(默认情况下为‘/n‘,‘/t‘,‘/r‘,‘ ‘) string.strip(chars=None,/),有返回值
string="hello,world"
a=string.strip(‘l‘)
print(a)
a="hello,world"
string="hello,world"
string.strip(‘l‘)
print(string)
"hello,world"
string="hello,world"
a=string.strip(‘h‘)
print(a)
a="ello.world"
原文:https://www.cnblogs.com/kkouba/p/11217080.html