title: Removing \r\n from a Python list after importing with readlines
body: <p>I have saved a list of ticker symbols into a text file as follows:</p>
  
  <pre><code>MMM
  ABT
  ABBV
  ANF
  ....
  </code></pre>
  
  <p>Then I use readlines to put the symbols into a Python list:</p>
  
  <pre><code>stocks = open(textfile).readlines()
  </code></pre>
  
  <p>However, when I look at the list in it contains Windows end-of-line delimiter which I do not want:</p>
  
  <pre><code>list: ['MMM\r\n', 'ABT\r\n', 'ABBV\r\n', 'ANF\r\n', 'ACE\r\n', 'ACN\r\n', 'ACT\r\n', 'ADBE\r\n', 'ADT\r\n', 'AMD\r\n', 'AES\r\n', .....
  </code></pre>
  
  <p>Can someone suggest the easiest way to remove these unwanted characters?</p>