From 2fadfdd308ed2bd0b22503d2f24513a3cef98c0d Mon Sep 17 00:00:00 2001 From: Ravitejavelamuri <39962669+Ravitejavelamuri@users.noreply.github.com> Date: Thu, 1 Oct 2020 00:29:50 +0530 Subject: [PATCH] Update Assignment 8.5.py --- week8/Assignment 8.5.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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")