擅长:python、mysql、java
<p>根据您提供的有限信息,我首先检查<code>a</code>和<code>b</code>是否存在。然后出现<code>a</code>not <code>b</code>或<code>b</code>not <code>a</code>。这样你就不会错过任何条件。你知道吗</p>
<pre><code>if 'a' in args and 'b' in args:
print "x" # execute "x"
elif "a" in args:
print "x" # execute "x"
elif "b" in args:
print "y" # execute "y"
else:
print 'ERROR need "a" or "b"'
</code></pre>
<p>我也不明白为什么不使用<code>if-elif-else</code>而不是多个<code>ifs</code>。这些应该是或条件之一。你知道吗</p>