Concerning Dictionaries and += in Python 2.x

Denis McMahon denismfmcmahon at
Wed Jan 21 15:10:48 CET 2015

On Wed, 21 Jan 2015 09:43:31 +0100, Peter Otten wrote:

> There is also dict.from_keys()

See, I learned something too.

> The inner loop is not just inefficient for stock sold in large
> quantities,

Agreed, but as for:

> it will fail for stock sold by weight, volume etc.

I was trying to stay true to OPs original code and not introduce [too 
many] additional complications to his learning exercise.

Denis McMahon, denismfmcmahon at

More information about the Python-list mailing list