<div>
</div>
<p>现在我知道这个问题听起来很奇怪,但我发现自己的处境可能需要避免在列表上循环,除非我设法找出问题的根源</p>
<p>问题是:</p>
<pre><code>def SomeFunction(args):
someList = [here, are, list, elements]
print (someList) # works normal
for elem in someList:
print (elem) # side effects observed here (and not sure why at this stage), only the first element is printed
</code></pre>
<p>有没有其他方法可以像for循环那样访问列表元素</p>