title: Saving an index from a list in a while loop in Python
body: <p>How do you save an index of a list while in a 'while' loop?</p>
  
  <p>Basically I am running through a text file and I want to identify a date, and then afterwards get the information that corresponds to that date which is the line below. So far I can match the date entered to the line with that date but don't know how to save that line so I can get he information from the line below.</p>
  
  <pre><code>f = open("studentinfo.txt")
  #ask for date
  d = input("Enter the date:")
  date = [d]
  #check to see if date is avialable
  while True:
      line = f.readline().split()
      if line:
          if line == date:
              print(line)
              #save data in here, index etc
      else:
          break
          print("No data available")
  </code></pre>