title: Sort dictionary in Python based on other dictionary keys
body: <p>I have two dictionary <code>x</code> and <code>y</code></p>
  <p>Input -</p>
  <pre><code>x = {&quot;a&quot;:1, &quot;b&quot;: 2, &quot;c:3&quot;, &quot;d&quot;:5}
  
  y = {&quot;c&quot;:3000, &quot;a&quot;:10000}
  </code></pre>
  <p>Expected Output -</p>
  <pre><code>y = {&quot;a&quot;:10000, &quot;c&quot;:3000}
  </code></pre>
  <p>The orders of key of dictionary <code>y</code> should be based on order of keys in <code>x</code> dictionary
  These two dictionary are coming from different source.</p>
  <p><strong>Edit -<code>y</code> will have only keys that are already present in x, Also the values of key in y will be  different than x</strong></p>
  <p>Any help would be much appreciated.
  Thanks!</p>