擅长:python、mysql、java
<p>不知道你想做什么,但也许你的意思是:</p>
<pre><code>aa = {'ALA':'A'}
test = ['ALA'] ### note this is now a list!
for i in test:
if i in aa:
print i, aa[i] #### note i is the key, aa[i] is the value
</code></pre>
<p>请注意,您可以从字典中生成三种不同类型的迭代器:</p>
^{pr2}$