diff --git a/week8/Assignment 8.5.py b/week8/Assignment 8.5.py index 194965b..dc53d77 100644 --- a/week8/Assignment 8.5.py +++ b/week8/Assignment 8.5.py @@ -42,14 +42,14 @@ #cwen@iupui.edu #There were 27 lines in the file with From as the first word -fname = raw_input("Enter file name: ") +fname = input("Enter file name: ") if len(fname) < 1 : fname = "mbox-short.txt" fh = open(fname) -count = 0 +c = 0 l = [i.split() for i in fh.readlines() if i.startswith("From") and i.find("@")>0 and len(i.split())>2] for i in l: print i[1] - count+=1 -print "There were", count, "lines in the file with From as the first word" + c+=1 +print("There were", c, "lines in the file with From as the first word")