擅长:python、mysql、java
<p>Python中if语句的语法为</p>
<pre><code> if *condition*:
statements
else:
statements
</code></pre>
<p>在代码中,if和else部分缺少冒号(:)。你知道吗</p>
<pre><code>list= []
list.append("item1")
list.append("item2")
list.append("item3")
print True if "item1" in list else False
</code></pre>