title: Reading from text file into python list
body: <p>Very new to python and can't understand why this isn't working. I have a list of web addresses stored line by line in a text file. I want to store the first 10 in an array/list called bing, the next 10 in a list called yahoo, and the last 10 in a list called duckgo. I'm using the <code>readlines</code> function to read the data from the file into each array. The problem is nothing is being written to the lists. The count is incrementing like it should. Also, if I remove the loops altogether and just read the whole text file into one list it works perfectly. This leads me to believe that the loops are causing the problem. The code I am using is below. Would really appreciate some feedback.</p>
  
  <pre><code>count=0;
  
  #Open the file
  fo=open("results.txt","r")
  
  #read into each array
  while(count&lt;30):
      if(count&lt;10):
          bing = fo.readlines()
          count+=1
          print bing
          print count
  
      elif(count&gt;=10 and count&lt;=19):
          yahoo = fo.readlines()
          count+=1
          print count
  
      elif(count&gt;=20 and count&lt;=29):
          duckgo = fo.readlines()
          count+=1
          print count
  
  print bing
  print yahoo
  print duckgo
  
  fo.close
  </code></pre>