How can I report an error if the existing dictionary sees another item in python with the same key but different value
<p>Firstly, Suppose I have a dictionary like given below:</p>

<pre><code>temp = {'A': 3, 'S': 1}
</code></pre>

<p>Now if I encounter an item like <code>'A': 4</code> will it be added to the dictionary something like:</p>

<pre><code>temp = {'A': 4, 'S': 1} 
</code></pre>

<p>leaving behind the previously value of key <code>A</code> which was <code>3</code></p>

<p>Secondly, if my dictionary is </p>

<pre><code>{'A': 3, 'S': 1} 
</code></pre>

<p>How can I report an error if the dictionary sees another item like <code>'A': 4</code> or <code>'S': 5</code></p>
