title: Multiple lines of data, want to get an index or figure out how to get it in order
body: <ol>
  <li>reads and stores the data in this file.</li>
  <li>User for two integers corresponding to start and end years, and finds and lists the year of publication, title, author, in that order, of all books published during that period.</li>
  <li>It repeats the previous step till the user enters -1 when prompted for the start year.</li>
  </ol>
  <p>This is what I have so far (see picture)</p>
  <pre><code>def main(): 
      file = open(&quot;resources.txt&quot;,&quot;r&quot;) 
      myList = [] 
      year1 = int(input(&quot;Enter the first year:&quot;)) 
      year2 = int(input(&quot;Enter the second year: &quot;)) 
      for x in range(year1, year2): 
          print(yearofpublication,title, author)
      
  </code></pre>
  <p>and the file is 1000 lines</p>
  <p>I need help with #2 mainly.
  Thank you</p>
  <p><a href="https://i.stack.imgur.com/inpk7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/inpk7.png" alt="enter image description here" /></a></p>