PForE_7.2
fname = input("Enter file name: ")
fh = open(fname)
count = 0
total = 0
for line in fh:
if not line.startswith("X-DSPAM-Confidence:"):
continue
count = count + 1
number = line[19:]
number = number.rstrip()
number = float(number)
total = number + total
average = total/count
print("Average spam confidence:",average)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)