From 0ba07edfcef15d677b79af66e3cb23ff9158ee30 Mon Sep 17 00:00:00 2001 From: Sanduni Ridmika <62992362+Sanduni-Ridmika@users.noreply.github.com> Date: Sat, 17 Oct 2020 03:02:59 +0530 Subject: [PATCH] Update Assignment 7.1.py --- week7/Assignment 7.1.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/week7/Assignment 7.1.py b/week7/Assignment 7.1.py index 0bad8f4..b65dcce 100644 --- a/week7/Assignment 7.1.py +++ b/week7/Assignment 7.1.py @@ -34,6 +34,5 @@ # Use words.txt as the file name fname = raw_input("Enter file name: ") fh = open(fname) -for i in fh: - i = i.rstrip().upper() - print i +for line in fh.readlines(): + print(line.upper().strip())