PForE_8.4.py
fname = input("Enter file name: ")
fh = open(fname)
counts = dict()
lst = list()
for line in fh:
wds = line.split()
for wd in wds:
if wd not in lst:
lst.append(wd)
continue
lst.sort()
print(lst)
PForE_8.4.py
fname = input("Enter file name: ")
fh = open(fname)
counts = dict()
lst = list()
for line in fh:
wds = line.split()
for wd in wds:
if wd not in lst:
lst.append(wd)
continue
lst.sort()
print(lst)