title: if item in list exists: do stuff
body: <p>Suppose I have the list, which I have edited so it's not just called "list" anymore </p>
  
  <pre><code>my_list = ['a b', 'b c d e', 'c', 'd e f g h', 'e f g h i j', 'f g h', 'g h']
  </code></pre>
  
  <p>I am trying to examine a specific element in the list, and see if one of the elements contains a certain string. I've been using something along the lines of the code below:</p>
  
  <pre><code>for i in range(len(my_list)):
      splitList = my_list[i].split(' ')
      if splitList[3] == "c":
          print "True"
      else:
          print "False"
  </code></pre>
  
  <p>but what I really want to do is check to see if splitList[3] even exists, and if it does, if  it == "c" or simply print the 3rd "thing" in the element. (I'm being generic in my question, but my actual data is looking for a specific 3 character string)  I'm certain regular expressions would solve all my problems but I've been looking for the perfect regex solution for days and am overwhelmed and without a solution. My data is very predictable and and I just need to check if the second word in an element of a list is there or not.</p>
  
  <p><strong>Is there a simple pythonic way to check to see if the a list even HAS something at a specific index, and if it does to go on from there?</strong></p>
  
  <hr>
  
  <p>If you want to suggest a regex solution,
  the 24th element in my list is always 
  "G# Abc"   '#' can be 1-12 inclusive
  and then the 25th element may also be<br>
  " G# Abc"   with '#' as 1-12
  if the 25th element is not in the format " G# Abc", then the element and any other elements is not relevant. If it is in the format " G# Abc", I need to add the number to a new list.</p>