title: returning a list of words after reading a file in python
body: <p>I have a text file which is named <code>test.txt</code>. I want to read it and return a list of all words (with newlines removed) from the file.  </p>
  
  <p>This is my current code:  </p>
  
  <pre><code>def read_words(test.txt):
      open_file = open(words_file, 'r')
      words_list =[]
      contents = open_file.readlines()
      for i in range(len(contents)):
           words_list.append(contents[i].strip('\n'))
      return words_list    
      open_file.close()  
  </code></pre>
  
  <p>Running this code produces this list:</p>
  
  <pre><code>['hello there how is everything ', 'thank you all', 'again', 'thanks a lot']
  </code></pre>
  
  <p>I want the list to look like this:</p>
  
  <pre><code>['hello','there','how','is','everything','thank','you','all','again','thanks','a','lot']
  </code></pre>