擅长:python、mysql、java
<p>枚举在第一次正确运行时,将所有行更改为</p>
<pre><code> x[0] = line10\n
x[1] = line20\n
x[2] = line30\n
</code></pre>
<p>如果你的陈述不再适用。他们还在找<code>if x[0] == 'line1\n':</code>,但现在<code>x[0] = line10\n</code></p>
<p>你能不能不这样试着用它们在数组中的位置来检查它们?你知道吗</p>
<pre><code>for y in range(3):
for n in enumerate(x):
if n == 0
x[n] = 'line1' + str(y) + '\n'
if n == 1
x[n] = 'line2' + str(y) + '\n'
if n == 2
x[n] = 'line3' + str(y) + '\n'
print(''.join(x))
</code></pre>