Commit 9d97d73c by BellCodeEditor

auto save

parent 3c6ebc4d
Showing with 5 additions and 8 deletions
import csv import csv
with open("a.csv","r",encoding="utf-8") as f:
data = [["姓名", "语文", "数学", "英语"], f_csv = csv.reader(f)
["小贝", 98, 99, 92], f_csv = list(f_csv)
["聪聪", 95, 91, 95]] print(f_csv[1][2])
with open("a.csv","w",encoding="utf-8",newline='') as f: \ No newline at end of file
writer=csv.writer(f)
writer.writerows(data)
\ No newline at end of file
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