title: How to compare list values with dictionary keys and make a new dictionary of it using python
body: <p>I have a list like this:</p>
  
  <pre><code>lis = ['Date', 'Product', 'Price']
  </code></pre>
  
  <p>I want to compare it with:</p>
  
  <pre><code>dict = {'Date' : '2013-05-01', 'Salary' : '$5000', 'Product' : 'Toys', 'Price' : '$10', 'Salesman' : 'Smith'}
  </code></pre>
  
  <p>I want to compare each item of list with keys of dictionary and make a new dictionary.<br>
  What I have tried is:</p>
  
  <pre><code>n = {}
  for k,v in dict.items():
      for i in lis:
          if i==k:
              n[k] = v
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>n = {'Date' : '2013-05-01', 'Product' : 'Toys', 'Price' : '$10'}
  </code></pre>
  
  <p>This works but I want to do it through generators - can someone help me do that?</p>