擅长:python、mysql、java
<p>如果你仔细看一下剥离功能的帮助
上面写着:</p>
<pre><code>Help on built-in function strip:
strip(...)
S.strip([chars]) -> string or unicode
Return a copy of the string S with leading and trailing
whitespace removed.
If chars is given and not None, remove characters in chars instead.
If chars is unicode, S will be converted to unicode before stripping
</code></pre>
<p>它将删除所有前导和尾随字符以及空白。在你的例子中,字符集是</p>
<pre><code>s, e, r, v, i, c, C, h, k and _
</code></pre>
<p>你可以通过这样的方式找到邮局局长</p>
<pre><code>a = "serviceCheck_postmaster"
print a.split("_")[1]
</code></pre>