Advertisement
Guest User

Untitled

a guest
Jun 13th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. # Use the file name mbox-short.txt as the file name
  2. fname = input("Enter file name: ")
  3. fh = open(fname)
  4. p = 0
  5. for line in fh:
  6. if line.startswith("X-DSPAM-Confidence:") :
  7. p = 1 + p
  8. z = line[20:28]
  9. y = z + z
  10. mean = y / p
  11. print(mean)
  12.  
  13. print("Done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement