title: Read only specific lines
body: <p>I only want to read certain lines, for example lines in the range from 0 to 10 and the program should check the correctness of the data entered by the user.</p>
  
  <pre><code>from ftplib import FTP
  from ftplib import error_perm
  
  start = 0 # some starting index
  end = 5
  
  with open('string.txt', 'rb') as password_list:
       for i,line in enumerate(password_list):
         if(i&gt;start &amp; i&lt;end):
          line=line.replace(b'\n',b'').replace(b'\r',b'')
          password=line.decode("utf-8")
  </code></pre>