import csv
with open('students_scores.csv', 'r', encoding='utf-8') as infile:
reader = csv.reader(infile)
headers = next(reader)
with open('qualified_students.csv', 'w', encoding='utf-8', newline='') as outfile:
writer = csv.writer(outfile)
writer.writerow(headers)
for row in reader:
name = row[0]
chinese_score = int(row[1])
math_score = int(row[2])
english_score = int(row[3])
total_score = chinese_score + math_score + english_score
if total_score > 240 and chinese_score >= 70 and math_score >= 70 and english_score >= 70:
writer.writerow(row)