1、strip()函数用于删除指定字符串头尾信息(默认为空格)
不加参数:
s = ' this is a example ' print(s) print(s.strip())
"D:\Program Files (x86)\python.exe" D:/python/file.py this is a example this is a example Process finished with exit code 0
加参数:
s = ' 0000this is a example