Commit 8b839b67 by BellCodeEditor

save project

parent 3ce3a866
Showing with 18 additions and 9 deletions
#"""读取csv文件""""
import csv import csv
with open('report.csv',"r", encoding="utf-8")as f: subject = ["姓名","语文","数学","英语"]
f_csv = csv.reader(f) score1 = ["小贝",98.99,92]
f_csv = list(f_csv) score2 = ["小贝",95.91,95]
pipi = f_csv[7]
print(pipi)
for row in f_csv: with open("scores.csv","w", encoding="utf-8")as csvfile:
print(row[3]) writer = csv.writer(csvfile)
\ No newline at end of file writer.writerow(subject)
writer.writerow(score1)
writer.writerow(score2)
\ No newline at end of file
姓名,语文,数学,英语
小贝,98.99,92
小贝,95.91,95
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment