Open tchandra05 opened 6 years ago
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))
int add is not define
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))