Skip to content

Commit 74e7113

Browse files
committed
assignment has been finished
1 parent 17cbc4b commit 74e7113

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

assignment.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Use the file name mbox-short.txt as the file name
2+
3+
fname = input("Enter file name: ")
4+
fh = open(fname)
5+
count = 0
6+
average = 0
7+
for line in fh:
8+
if not line.startswith("X-DSPAM-Confidence:") : continue
9+
average += float(line[20:-1].strip())
10+
count = count + 1
11+
#print(line)
12+
13+
print("Average spam confidence:", (average/count))

0 commit comments

Comments
 (0)