2013-07-24 122 views

回答

2

嘗試下面的代碼:

with open('input.txt') as f, open('output.txt', 'w') as fout: 
    fout.writelines(line for lineno, line in 
         enumerate(f, 1) if lineno not in (3,4,5)) 
相關問題