发布时间:2019-09-21 10:57:02编辑:auto阅读(6059)
字符串里有三个去空格的函数
strip 同时去掉左右两边的空格
lstrip 去掉左边的空格
rstrip 去掉右边的空格
>>>a=" gho stwwl "
>>>a.lstrip()
'gho stwwl '
>>>a.rstrip()
' gho stwwl'
>>>a.strip()
'gho stwwl'
上一篇: 卸载python最干净的办法
下一篇: Python 中的range(),ara
51931
51708
42022
38862
33350
30318
28961
23973
23889
22252
395°
2592°
3263°
2721°
2706°
3443°
2664°
3502°
5775°
5553°