title: python check duplicates key in dictionary
body: <p>I need help trying to write a function for detecting if there is a dictionary which contains multiple keys. So im stuck since when using name_to_age the dictionary will already be unique so I am not sure how I can apply this check.</p>
  
  <p>for e.g</p>
  
  <pre><code># the test function should raise an error since there is 2 duplicate keys
  name_to_age = {'Sam': 2, 'Sam': 4, 'Alex: 14}
  </code></pre>