title: Find the lines in the text file
body: <p>You will implement function index() that takes as input the name of a text file and a list of words. For every word in the list, your function will find the lines in the text file where the word occurs and print the corresponding line numbers (where the numbering starts at 1). You should open and read the file only once.</p>
  
  <p>I have been only able to count the occurrence once. </p>
  
  <pre><code>def index(filename, words):
      infile = open(filename)
      content = infile.readlines()
      infile.close()
      count = {}
      for word in words:
          if word in count:
              count[word] += 1
          else:
              count[word] = 1
          for word in count:
              print('{:12}{},'.format(word, count[word]))
  
      Output :index('raven.txt',['raven'])
          raven       1,
      Desired Output : index('raven.txt',['raven'])
         raven 44, 53, 55, 64, 78, 97, 104, 111, 118, 12(No of lines it appear)
  </code></pre>