title: Finding partial matches in a list of lists in Python
body: <p>I have a list of lists and I need to find and print the list that contains full and partial matches using two conditions ignoring case.</p>
  
  <pre><code>l = [['2014','127.0.0.1','127','DNS sever Misconfiguration'],['2014','192.168.1.25','529','Failed logon for user user1'],['2014','127.0.0.1','1','This is a test message']]
  </code></pre>
  
  <p>Condition 1 and 2 can be anything, i.e. '192.186.1.25' or 'failed'</p>
  
  <pre><code>&gt;&gt;&gt; for i in l:
          if 'condition 1' in i and 'condition2' in i:
             print i
  </code></pre>
  
  <p>gives  ... nothing</p>
  
  <p>I can use only one condition that has exact matching and get a result </p>
  
  <pre><code>&gt;&gt;&gt; for i in l:
        if '127.0.0.1' in i:
          print i
  
  
  ['2014', '127.0.0.1', '127', 'DNS sever Misconfiguration']
  ['2014', '127.0.0.1', '1', 'This is a test message']
  </code></pre>
  
  <p>Any help would be appreciated</p>