title: How to intersect dictionaries?
body: <p>I haven't taken python in a long time and am a bit rusty but for the first question I'm taking a dictionary and need to intersect it returning the key and the value. So for example, I'm entering</p>
  
  <pre><code>a = {1:'a1', 2.5:'a2', 4:'a3'}
  b = {1:'a1', 3:'a2',  5:'a4'}
  </code></pre>
  
  <p>If I enter <code>c = intersect(a,b)</code>, I want it to return <code>{1:'a1'}</code>, but I only get back <code>{'a1'}</code>.</p>
  
  <p>My code so far is:</p>
  
  <pre><code>def intersect(a, b):
      for i in a:
          if j in b:
              if a[i]==b[i]:
                  return ({i})
          else:
              return {}
  </code></pre>