title: Python: most effcient way to strip line from text file
body: <p>How does one go about a for loop and changing the entries in the list?  Like, the equivalent of <code>[line.strip() for line in lines]</code>, except that <code>line.strip()</code> is saved back to the lines list.</p>
  
  <p>This is needed because I am using a large dataset, stored in the list.  This dataset will be used to for machine training to train a classifier.  Specifically, natural language processing using the NLTK lib.  Hence, duplication of the array is not feasible.</p>