find minimum associated values

John Machin sjmachin at
Fri Jan 25 22:40:10 CET 2008

On Jan 26, 7:58 am, bearophileH... at wrote:
> I find the first and third solutions simpler to read, and the first
> solution requires less memory, it probably works quite well with
> Psyco, and it's easy to translate to other languages (that is
> important for programs you want to use for a lot of time or in
> different situations), so I'd use the first solution.

The first solution, once one changes "d = dict()" to "d = {}", is
quite free of any impediments to ease of reading, uses the minimum
necessary memory to build the required dict [and it's quite obvious by
inspection that this is so], and is the easiest to "translate" to
earlier versions of Python.

More information about the Python-list mailing list