 <p>I think it would be cleaner to use <code>defaultdict</code>:</p> <pre><code>from collections import defaultdict mydict = defaultdict(lambda: 0) for x in cleanList: mydict[x[0]] += float(x[1]) </code></pre>