how to keep the structure of the dictionary
<p>Well i have the following dictionary:</p>

<pre><code> {'3d1011c0bade5f0a064f7daeef09e7acf900cfe8af09e025859b3426': ['mils news 02122002_0005.txt', 1] }
</code></pre>

<p>Where </p>

<pre><code> ['mils news 02122002_0005.txt', 1]
</code></pre>

<p>is a list. And now i have the following:</p>

<pre><code>result_array = {k: db_array.get(k, 0)[1] + db_array.get(k, 0)[1] for k in set(db_array) | set(db_array)}
</code></pre>

<p>with this i want to sum the number that is in the list with another dictionary. So my question is how to keep the dictionary unchanged, coz i get the following:</p>

<pre><code>{'3d1011c0bade5f0a064f7daeef09e7acf900cfe8af09e025859b3426': 2}
</code></pre>

<p>as a result.</p>

<p>Expected output:</p>

<pre><code>{'3d1011c0bade5f0a064f7daeef09e7acf900cfe8af09e025859b3426': ['mils news 02122002_0005.txt', 2] }
</code></pre>

<p>According to the first answer of the user, tnx for the solution but i get the following for different keys:</p>

<pre><code>db_array = {'a': ['mils news 02122002_0005.txt', 3]}
&gt;&gt;&gt; result_array = {'b': ['mils news 02122002_0005.txt', 3]}
&gt;&gt;&gt; result_array = {k: [db_array[k][0],db_array[k][1] + result_array.get(k, ['', 0])[1]] for k in set(db_array) | set(result_array)}
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "&lt;stdin&gt;", line 1, in &lt;dictcomp&gt;
KeyError: 'b'
</code></pre>
