infile = open('Fdeg.dat','r') for i in range(3): infile.readline() Fdegrees = [] Cdegrees = [] for line in infile: F = float(line.split()[-1]) C = (F-32)*5.0/9 Fdegrees.append(F) Cdegrees.append(C) infile.close() outfile = open('F2C.txt','w') for F,C in zip(Fdegrees,Cdegrees): outfile.write('%4.2f %4.2f \n' %(F,C)) outfile.close() """ Terminal> python f2c_file_read_write.py Terminal> more F2C.txt 67.20 19.56 66.00 18.89 78.90 26.06 102.10 38.94 32.00 0.00 87.80 31.00 """