title: How to list out the key for certain elements of dictionary in Python
body: <p>I have a dictionary mapping:</p>
  
  <pre><code>k=[1,3,5,7,9]
  matrix = { 1:[0,0], 2:[0,1], 3:[0,2], 4: [1,0], 5:[1,1], 6:[1,2], 7:[2,0], 8:[2,1], 9:[2,2]};
  j=[matrix[i] for i in k]
  print ("output=",j)
  </code></pre>
  
  <p>and the output is </p>
  
  <pre><code>output =[[0, 0], [0, 2], [1, 1], [2, 0], [2, 2]]
  </code></pre>
  
  <p>My question is how to print back the keys for the certain elements in the dictionary matrix orderly as below:</p>
  
  <pre><code>key=[1,3,5,7,9]
  </code></pre>
  
  <p>I hope that somebody may help me in this matter. Thank you.</p>