On Mar 13, 9:26 am, ru... at yahoo.com wrote: > That should be: > d = {} > for item in m: key = item[0]; value = item[1] > if key is None or value is None: continue > if key not in dict: > d[key] = [1, value] > else: > d[key][0] += 1 > d[key][1] += value That's it. Any other mistakes, you find 'em.