title: Finding an index in an array in python
body: <p>I have looked at 
  <a href="https://stackoverflow.com/questions/176918/finding-the-index-of-an-item-given-a-list-containing-it-in-python?lq=1">Finding the index of an item given a list containing it in Python</a></p>
  
  <p>and I have not found a solution. I have a list I appended of 426 values and I am looking for the index of 'KORD' but it claims it is not in the list, when it is. </p>
  
  <pre><code>metar_txt = open("metar.txt", "r") 
  lines = metar_txt.readlines() 
  for line in lines: 
      if len(line) &gt; 20: 
          stations = []
          stations.append(line.split(' ')[0])
          print stations.index('KORD')
  metar_txt.close()
  
  ---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-34-9271d129d452&gt; in &lt;module&gt;()
        5         stations = []
        6         stations.append(line.split(' ')[0])
  ----&gt; 7         print stations.index('KORD')
        8 metar_txt.close()
  
  ValueError: 'KORD' is not in list
  </code></pre>