tchandra05 / mbox-short.txt

notdefined
0 stars 0 forks source link

avoid using sum function and variable as sum in solution #1

Open tchandra05 opened 6 years ago

tchandra05 commented 6 years ago

Use the file name mbox-short.txt as the file name

fname = input("Enter file name: ") fh = open(fname) rez = [] add = [] for line in fh.readlines(): if line.startswith("X-DSPAM-Confidence:"): line.replace(" ","") ind = line.find(":") rez.append(float(line[ind+1:]))

print("Average spam confidence:", intadd[rez] / len(rez))

tchandra05 commented 6 years ago

int add is not define