title: How to extract last line of text in Python (excluding new lines)?
body: <p>Textfile:</p>
  
  <pre><code>1
  2
  3
  4
  5
  6
  \n
  \n
  </code></pre>
  
  <p>I know <code>lines[-1]</code> gets you the last line, but I want to disregard any new lines and get the last line of text (6 in this case). </p>