擅长:python、mysql、java
<p>在这个用例中,您需要<code>replace()</code>,而不是<code>strip()</code></p>
<pre><code>word.replace('_ ', '')
</code></pre>
<p><code>strip()</code>:</p>
<blockquote>
<p>string.strip(s[, chars])</p>
<blockquote>
<p>Return a copy of the string with leading and trailing characters removed. If chars is omitted or None, whitespace characters are removed. If given and not None, chars must be a string; the characters in the string will be stripped from the both ends of the string this method is called on.</p>
</blockquote>
</blockquote>
<p><code>replace()</code>:</p>
<blockquote>
<p>string.replace(s, old, new[, maxreplace])</p>
<blockquote>
<p>Return a copy of string s with all occurrences of substring old replaced by new. If the optional argument maxreplace is given, the first maxreplace occurrences are replaced.</p>
</blockquote>
</blockquote>
<p><a href="https://docs.python.org/2/library/string.html" rel="nofollow noreferrer">Strings in Python</a></p>