Commit c86bb9eb by BellCodeEditor

save project

parent 97ee6521
Showing with 33 additions and 3 deletions
"""读取csv文件""""
"""读取csv文件"""
import csv
with open
\ No newline at end of file
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
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