Skip to content

Instantly share code, notes, and snippets.

@manichabba
Created August 1, 2016 00:14
Show Gist options
  • Save manichabba/ae0db8411b36b49b4d0974c7df7d3602 to your computer and use it in GitHub Desktop.
Save manichabba/ae0db8411b36b49b4d0974c7df7d3602 to your computer and use it in GitHub Desktop.
fname = raw_input("Enter file name: ")
fh = open(fname)
lst = list()
for line in fh:
for word in line.split():
if word not in lst:
lst.append(word)
lst.sort()
print lst
fname = raw_input("Enter file name: ")
fh = open(fname)
lst = list()
for line in fh:
for word in line.split():
if word not in lst:
lst.append(word)
lst.sort()
print lst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment