title: Python: TypeError: object of type 'NoneType' has no len()
body: <p>I am getting an error from this Python code:</p>
  
  <pre><code>with open('names') as f:
      names = f.read()
      names = names.split('\n')
      names.pop(len(names) - 1)
      names = shuffle(names)
      f.close()
  
  assert len(names) &gt; 100
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Python: TypeError: object of type 'NoneType' has no len()
  </code></pre>
  
  <p>The assert statement is throwing this error, what am I doing wrong?</p>