擅长:python、mysql、java
<p>我不确定我是否完全明白你想做什么,是不是这样?</p>
<pre><code>f1 = open ('car_names.txt')
f2 = open ('car_descriptions.txt')
for car_name in f1.readlines ():
for i in range (6): # echo the first 6 lines
print f2.readline ()
assert f2.readline() == '@CAR_NAME' # skip the 7th, but assert that it is @CAR_NAME
print car_name # print the real car name
for i in range (33): # print the remaining 33 of the original 40
print f2.readline ()
</code></pre>