title: Use A Single Line To Loop Two Dictionaries To Create List
body: <p>I have looked at several threads similar but unable to get a workable solution. I am looping (2) dictionaries trying to create a single list from the values of one based on the keys of another. I have it done with for loops but looking to use a single line if possible.  My code with for loops </p>
  
  <pre><code>  for k, v in dict1.items():
      for value in dict2[k]:
      temp.append(value)
  </code></pre>
  
  <p>On the first loop thru the temp list would be and is from above code:</p>
  
  <pre><code>[16,18,20,22,24,26]
  </code></pre>
  
  <p>I then use min to get the min value of the list. Now I want to condense the for loop to a one liner. I have put together </p>
  
  <pre><code>temp=[dict2.values() for k in dict1.keys() if k in dict2.keys()]
  </code></pre>
  
  <p>When executed, instead of temp being a single list for the k that exist in the dict1, I get a list of list for all the values from all dict2. </p>
  
  <pre><code>[[16,18,20,22,24,26], [12,16,18,20,22,24], [16,18,22,26,30,32]]
  </code></pre>
  
  <p>It seems to be ignoring the if statement. I know my dict1 has only 1 key in this situation and I know the 1 key exist in the dict2. Is my one liner wrong?</p>
  
  <p>Input Values for dictionaries:</p>
  
  <pre><code>dict1={'table1':[16,18,20,22,24,26]}
  
  dict2={'table1':[16,18,20,22,24,26],'table2': [12,16,18,20,22,24], 'table3': [16,18,22,26,30,32]}
  </code></pre>