> (1) iterating over foo: > for key in foo: > foo[key] += bar.get(key, 0) > > (2) iterating over bar: > for key in bar: > foo[key] += bar[key] > > I (again) challenge you to say *why* you feel that the "iterating over > bar" solution will not work.
Well if you're going to be clever enough to iterate over bar and then send the results to another dictionary altogether, I obviously cannot put up a good argument on this matter! Thanks for the input, I appreciate it. -- http://mail.python.org/mailman/listinfo/python-list