擅长:python、mysql、java
<p>我通常在做任何事情之前使用<code>user_input = input()</code>。在</p>
<p>固定版本:</p>
<pre><code>while True:
user_input = input("Enter a number")
if user_input == "Q":
print("Bye")
exit()
num = int(user_input)
mod = num % 2
if (mod > 0):
print("This is an odd number")
elif (mod == 0):
print("This is an even number")
</code></pre>