Commit 48a8e923 by BellCodeEditor

auto save

parent 3faf4b37
Showing with 35 additions and 2 deletions
"""读取csv文件"""" """读取csv文件"""
\ No newline at end of file import csv
with open("report.csv", "r", encoding="utf-8") as f1:
d = csv.reader(f1)
d = list(d)
print(d[7][3])
for i in range(len(d)):
if d[i][0]=="小依":
k = i
break
for j in range(len(d[0])):
if d[0][j] == "历史":
s = j
break
print(d[k][s])
for j in range(len(d[0])):
if d[0][j] == "数学":
s2 = j
break
for i in range(len(d)):
print(d[i][s2], end=" ")
print()
zf = 0
for j in range(1,len(d[k])):
zf = zf + int(d[k][j])
print(zf)
pjf = 0
pjf = zf/(len(d[k])-1)
print("%.2f"%pjf)
\ 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