Valerio Pachera wrote: > d = {'uno':1, 'due':2, 'tre':3} > print(max(d)) > > stampa 'uno' perché la funzione max paragona le chiavi. > Io avrei bisogno di paragonare il valore associato alle chiavi.
>>> d = {'uno':1, 'due':2, 'tre':3} >>> print(max(d)) uno >>> print(max(d.values())) 3 http://docs.python.org/3/library/stdtypes.html#mapping-types-dict -- Nicola Larosa - http://www.tekNico.net/ My knowledge enables me to predict that if you choose a closed- source OS, you have dangerously underestimated the long-term harm to yourself from that choice. - Eric Raymond, July 2012 _______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python