Commit 9dd23fae by BellCodeEditor

save project

parent 521bcae5
Showing with 22 additions and 0 deletions
import csv
data = [["成绩", "语文", "数学"],
["一模",94,90],
["二模",96,104],
["三模",95,99]]
with open('cj.csv','w',encoding='utf-8',newline='') as csvfile:
writer=csv.writer(csvfile)
writer.writerows(data)
m=0
with open('cj.csv','r',encoding='utf-8') as csvfile:
f_csv=csv.reader(csvfile)
f_csv=list(f_csv)
print(f_csv[1])
for i in range(2):
print(f_csv[m][1])
m+=1
\ No newline at end of file
成绩,语文,数学
一模,94,90
二模,96,104
三模,95,99
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