擅长:python、mysql、java
<pre><code>cols = [i for i, col in enumerate(desc) if col[0].startswith('word')]
</code></pre>
<p>是“的缩写”</p>
<pre><code>cols = []
for i, col in enumerate(desc)
if col[0].startswith('word'):
cols.append(i)
</code></pre>
<p>所以你不应该把逗号看作是语句的分隔,而是值的分隔(例如<code>life, universe, everything = the_answer</code>或<code>li = [4, 2]</code>)</p>