daily pastebin goal
85%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top