title: how to count the total number of lines in a text file using python
body: <p>For example if my text file is:</p>
  
  <pre><code>blue
  green
  yellow
  black
  </code></pre>
  
  <p>Here there are four lines and now I want to get the result as four. How can I do that?</p>