Thursday, February 25, 2010

sorting a dictionary




How to sort a dictionary in Python:


s = sorted(dm_value.items(), key=lambda(k,v):(v,k))