擅长:python、mysql、java
<p>它只取决于循环的iteable中的值的数量是的。所以呢<code>for</code>关键字后面可以跟任意变量名。你知道吗</p>
<p>在本例中,由于<code>enumerate()</code>包含iterable的项,它使用了2个变量<code>i, col</code>。你知道吗</p>
<p>有关iterable解包的更多信息,请阅读pep3131<a href="https://www.python.org/dev/peps/pep-3132/" rel="nofollow">https://www.python.org/dev/peps/pep-3132/</a></p>
<blockquote>
<p>A tuple (or list) on the left side of a simple assignment (unpacking is not defined for augmented assignment) may contain at most one expression prepended with a single asterisk (which is henceforth called a "starred" expression, while the other expressions in the list are called "mandatory"). This designates a subexpression that will be assigned a list of all items from the iterable being unpacked that are not assigned to any of the mandatory expressions, or an empty list if there are no such items.</p>
</blockquote>