Word extraction multiline text file <blockquote> <p>Here I have created a code to: Extract indivisual words from a text file, Append only the words with no duplicates into a blank list and Sort them by alphabetical order.</p> </blockquote> <pre><code>fname = raw_input("Enter file name: ") fhandle = open(fname) wordlist = list() counter = 0 for line in fhandle: line = line.split() length = len(line) if line not in wordlist: wordlist.append(line[counter]) counter += 1 if counter == length: break print wordlist.sort() </code></pre> <blockquote> <p>Checking this in Pycharm still gives result 'None' although looking at live execution shows the words sorted in alphabetically ordered list but with duplicated words intact (see figures). I would love to decipher difference between append from file <a href="http://imgur.com/a/Zapbp" rel="nofollow">1</a> and from a variable <a href="http://imgur.com/fpB4DTe" rel="nofollow">2</a>.</p> </blockquote>