水木社区手机版
首页
|版面-Python的自由天空(Python)|
新版wap站已上线
返回
1/1
|
转到
主题:碰到一个字符串的坑
楼主
|
qlogic
|
2021-12-06 15:26:32
|
只看此ID
$ python
Python 2.7.18 |Anaconda, Inc.| (default, Apr 23 2020, 22:42:48)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> s='123s_s'
>>> s.rstrip('_s')
'123'
为啥会这样
_是保留字符吗?
--
FROM 119.139.199.*
1楼
|
gogqtdh
|
2021-12-06 15:39:29
|
只看此ID
https://docs.python.org/3/library/stdtypes.html
【 在 qlogic 的大作中提到: 】
: $ python
: Python 2.7.18 |Anaconda, Inc.| (default, Apr 23 2020, 22:42:48)
: [GCC 7.3.0] on linux2
: ...................
--
修改:gogqtdh FROM 222.29.98.*
FROM 222.29.98.*
2楼
|
qlogic
|
2021-12-06 15:42:21
|
只看此ID
thanks
【 在 gogqtdh (ECON) 的大作中提到: 】
:
https://docs.python.org/3/library/stdtypes.html
: [upload=1][/upload]
--
FROM 119.139.199.*
3楼
|
world
|
2021-12-06 15:47:30
|
只看此ID
这种经常有人搞错,Golang 里还有专门针对这个方法的静态检测。
【 在 qlogic (戒网了) 的大作中提到: 】
: $ python
: Python 2.7.18 |Anaconda, Inc.| (default, Apr 23 2020, 22:42:48)
: [GCC 7.3.0] on linux2
: ...................
--
FROM 114.245.109.*
1/1
|
转到
选择讨论区
首页
|
分区
|
热推
BYR-Team
©
2010.
KBS Dev-Team
©
2011
登录完整版
水木安卓官方客户端