Commit e84597d7 by BellCodeEditor

auto save

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