On Mar 28, 5:38 am, [EMAIL PROTECTED] wrote: > >>> dict = {'M':3, 'R':0, 'S':2} > >>> print dict > > {'S': 2, 'R': 0, 'M': 3} > > now if I wanted sorted values in list, i am not able to do this>>> print > dict.values().sort() > > None > > it returns None instead of [0, 2, 3]
Try: from pprint import pprint as pp pp(my_dict) It works well for other built-in types too. P.S it is not good to use a name, dict, that already has a use in Python. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list