infileName="grades.txt"
infile=open(infileName,"r")
outfileName="weightedavg.txt"
outfile=open(outfileName,"w")
for line in infile:
test=line.strip()
test=line.split()
fname=test[0]
lname=test[1]
grades=test[3::2]
weights=test[2::2]
grades=[int(i) for i in grades]
weights=[int(i) for i in grades]
weightedavg=????
用于加权平均的公式是(重量1 * grade1)+(重量2 * grade2)... +(+的Weightn园艺)采取加权平均用特定式
每一件事情的作品,我只是不不知道如何计算这个公式 – 2015-04-01 22:01:19