title: mapping list of numbers to dictionary keys with multiple values
body: <p>I will start with an example. let's say I have a dictionary such as:</p>
  
  <pre><code>d = {1:['A','B'],
       2:['C']}
  </code></pre>
  
  <p>and a list:</p>
  
  <pre><code>vals = [1,2]
  </code></pre>
  
  <p>I want to map these values in the list (vals) to all possible ones in the dictionary (d). so the output here should be two lists such as:</p>
  
  <pre><code>[[ 'A','C']['B','C']]
  </code></pre>
  
  <p>this is basically the problem I am facing now.  I thought I can do it with for loop but when we faced this dictionary and list of values,I couldn't do it using a for loop or even a nested loops:</p>
  
  <pre><code>d = {1:['A','B','C'] ,
       2:['D','E'],
       3:['F','G'],
       4:['I'] }
  
  values = [1,2,3,4]
  </code></pre>
  
  <p>the output here should be:</p>
  
  <pre><code>[['A', 'D', 'F', 'I'], 
   ['A', 'D', 'G', 'I'],
   ['A', 'E', 'F', 'I'], 
   ['A', 'E', 'G', 'I'],
   ['B', 'D', 'F', 'I'], 
   ['B', 'D', 'G', 'I'],
   ['B', 'E', 'F', 'I'],
   ['B', 'E', 'G', 'I'], 
   ['C', 'D', 'F', 'I'],
   ['C', 'D', 'G', 'I'],
   ['C', 'E', 'F', 'I'],
   ['C', 'E', 'G', 'I']]
  </code></pre>