Commit d7ee6297 by BellCodeEditor

auto save

parent b8eb7c84
Showing with 19 additions and 4 deletions
import csv import csv
subject = ["姓名", "语文", "数学", "英语"] q = [["姓名", "语文", "数学", "英语"],
score1 = ["小贝", 98, 99, 92] ["小贝", 98, 99, 92],
score2 = ["聪聪", 95, 91, 95] ["聪聪", 95, 91, 95]]
\ No newline at end of file
with open("score.csv","w",encoding="utf-8",newline="")as file:
f=csv.writer(file)
#f.writerow(q)
#f.writerow(s1)
#f.writerow(s2)
f.writerows(q)
with open("score.csv","r",encoding="utf-8",newline="")as file:
f=csv.reader(file)
f=list(f)
print(f[2][2])
print(f[0])
\ 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