newbie dictionary question

James Chapman
Sun Apr 21 18:46:11 EDT 2002


Hi,

I have a question about dictionaries. I've been coding up a system of
objects that represents the reuslts of different auctions. One thing I've
been doing constantly though is iterating over dictionaries where the keys
are the prices of the bids and the values are the bids at that amount.

I was wondering if there is an easy way to consolidate to dictionaries into
one, where if they both have the same key the resulting value can be
concatenated.

Also is there any similar syntax for dictionaries like the list syntax
"[some_function(x) for x in other_list]"?

Thanks,

James Chapman





More information about the Python-list mailing list