title: Is there a better way to iterate over nested loops in python
body: <p>I have some code that is running through nested loops. I am guessing that there is a more "pythonic" way of doing this. Any suggestions? </p>
  
  <p>The basic section of code looks like this: </p>
  
  <pre><code>   for e in range(len(listOfTuples)):
  
          for item in self.items:
              if item.getName() == listOfTuples[e][0]:
                  &lt;do stuff&gt;
              if item.getName() == listOfTyples[e][1]:
                  &lt;do other stuff&gt;
                  continue
  
          if &lt;both above if statements got answers&gt;:
              &lt;do yet more stuff&gt;
  </code></pre>
  
  <p>Is there a better way to write these nested loops? </p>