title: How to extract the first and last value from a txt file, in python?
body: <p>I have a txt file made like this:</p>
  <pre><code>2,5,25,6
  3,5,78,6,
  5,23,24,85
  6,4,79,9
  69,23,12,51
  </code></pre>
  <p>I should extract only two values that are the first value in the first line 2 and the first value in the last line 69.
  The program I wrote is the following:</p>
  <pre><code>with open(&quot;C:\values.txt&quot;, &quot;r&quot;) as fp:
      lines = fp.readlines()
  for i in range(0, len(lines)):
      print(lines[i])
  </code></pre>
  <p>but I can only print all the lines present in the txt file.</p>