擅长:python、mysql、java
<p>您可以使用<code>zip</code>:</p>
<pre><code>with open('random.txt', 'r') as fn:
next(fn)
first_col, _, third_col = [
*zip(*(int(x) for x in map(lambda x: x.split(','), fn))
]
...
results = [x+y for x, y in zip(first_col, second_col)]
</code></pre>
<p>或者如果你不需要抱着驴:</p>
<pre><code>results = [
x+y for x, _, y in zip(*(int(x) for x in map(lambda x: x.split(','), fn))
]
</code></pre>