擅长:python、mysql、java
<p>是的,它可以是这样的意思,也可以是一个简单的迭代器。例如:
迭代器示例:</p>
<pre><code>a=set(['1','2','3'])
for x in a:
print ('This set contains the value ' + x)
</code></pre>
<p>类似于支票:</p>
<pre><code>a=set('ILovePython')
if 'I' in a:
print ('There is an "I" in here')
</code></pre>
<p>编辑:编辑以包括集合而不是列表和字符串</p>