擅长:python、mysql、java
<p>这是根据<a href="https://docs.python.org/3.8/library/stdtypes.html?highlight=strip#str.strip" rel="nofollow noreferrer">Docs</a></p>
<blockquote>
<p>Return a copy of the string with the leading and trailing characters removed. The chars argument is a string specifying the set of characters to be removed. If omitted or None, the chars argument defaults to removing whitespace. The chars argument is not a prefix or suffix; rather, all combinations of its values are stripped</p>
</blockquote>
<p>在这种情况下,您最好使用<code>round</code>:</p>
<pre><code>s='10000.0'
print(str(round(float(s))))
</code></pre>