擅长:python、mysql、java
<p>进入while循环的Python方式如下:</p>
<pre class="lang-py prettyprint-override"><code>while not choice.isdigit():
choice = input("Please enter a number (0-10): ")
</code></pre>
<p>这将产生<code>True</code>,如果<code>choice</code>不是整数,您将访问while循环,当<code>choice</code>是整数时,则<code>not choice.isdigit()</code>条件将是<code>False</code>,您将退出while循环</p>