面试题答案
一键面试with open('input_file.txt', 'r') as infile, open('output_file.txt', 'w') as outfile:
for line in infile:
parts = line.strip().split(',')
if len(parts) == 3:
try:
score = int(parts[2])
if 60 <= score <= 80:
outfile.write(line)
except ValueError:
pass