擅长:python、mysql、java
<p>虽然alecxe有最好的答案,但还有一个选择:<strong>变量</strong>!你知道吗</p>
<pre><code>def test():
users = [u"sam", u"jay", u"jean", u"smo", u"gon", u"bil"]
user = u"jean"
found = False
for x in users:
if user == x:
found = True;
print found
</code></pre>