Commit 1f2fe061 by BellCodeEditor

save project

parent 7d245279
Showing with 19 additions and 2 deletions
"""读取csv文件""""
\ No newline at end of file
import csv
with open("report.csv","r",encoding="utf-8",newline="")as fi:
du=csv.reader(fi)
nr=list(du)
# for data in nr:
# for g in data:
# print(g,end=",")
# print()
for i in range(len(nr)):
if nr[i][0]=="小贝":
j=i
break
for i in range(len(nr[0])):
if nr[0][i]=="物理":
k=i
break
print(nr[j][k])
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