title: Comparing nested lists
body: <p>I have two lists, one of the form:</p>
  
  <pre><code>[a1, b1, [[c1, d1, e1], [f1, g1, h1], etc, etc], etc]
  </code></pre>
  
  <p>and the other, a dictionary, whose entries are in the form:</p>
  
  <p><code>[[a2, b2, c2], [d2, e2, f2], etc, etc]</code>. </p>
  
  <p>I need to compare the first entries of those two sub lists there and find any which are the same, and any in the first which don't appear at all in the second.</p>
  
  <p>Foe example, if <code>c1 = d2</code>, I'd want to know, and if <code>f1</code> isn't equal to either <code>a2</code> or <code>d2</code>, I'd want to know that.</p>
  
  <p>Anyway, I'm having a bit of trouble implementing this properly, any help would be appreciated.</p>
  
  <p>Thanks!</p>
  
  <p>(I'm not sure how clear the list formats are to understand, sorry if they're still confusing)</p>
  
  <p>CODE SAMPLE:</p>
  
  <pre><code>for row in range(0, len(command[2])):
  
      counter = 0
  
      for nodeRows in range(0, len(nodeTable[command[0]])):
  
          if nodeTable[command[0]][nodeRows][0] == command[2][row][0]:
  
              if ((command[2][row][2]) + 1) &lt; nodeTable[command[0]][nodeRows][2]:
  
                  counter += 1
  
                  newrow = command[2][row]
                  newrow[1] = command[1]
                  newrow[2] = newrow[2] + 1
  
                  nodeTable[command[0]][nodeRows] = newrow
  
                  change = 'true'
  </code></pre>
  
  <p>I imagine this doesn't help. The code is a bit monolithic (that's why I didn't post it initially). But I'm basically trying to compare two values. The first values of the items from the list in the 3rd position of another list and the first values of the items from the lists contained in another list.</p>
  
  <p>Um...sorry. I have tried making the code simpler, but it's a bit complicated.</p>