diff --git a/week8/Assignment 8.4.py b/week8/Assignment 8.4.py index efe5b5e..1c69b21 100644 --- a/week8/Assignment 8.4.py +++ b/week8/Assignment 8.4.py @@ -11,14 +11,14 @@ fname = 'romeo.txt' fh = open(fname) lst = list() -# Iterates through each line in filehandle + for line in fh: - #Iterates through each word on line + for i in line.split(): - #Checks to see if word is already in list + if not i in lst: - #Appends words to list + lst.append(i) lst.sort() -print lst +print(lst)