title: Method or function application on list of strings with if conditions
body: <p>I have two lists as follows: </p>
  
  <pre><code>a = ["aaa", "bbb", "ccc"]
  b = ["aaa", "bbb", "ddd", "eee"]
  </code></pre>
  
  <p>I would like to have a <code>print</code> (a function or a method more in general) of the <code>a[i]</code> elements if <code>a[i]==b[j]</code>.
  This is the code I wrote, it doesn't work because it returns four times the condition.</p>
  
  <pre><code>for i in range(len(a)):
      for j in range(len(b)):
          if a[i] == b[i]:
              print (a[i])
  </code></pre>