chinni wrote: > > > In Advance Sorting by giving the keywords to sort the list.But, iam > getting the fallowing errors > > >>> x = ['srikanth', 'kumar', 'muppandam', 'will', 'be', 'a'] > >>> x.sort(key=len) > Traceback (most recent call last): > File "<stdin>", line 1, in ? > TypeError: sort() takes no keyword arguments > >>> x.sort(reverse=True) > Traceback (most recent call last): > File "<stdin>", line 1, in ? > TypeError: sort() takes no keyword arguments
Are you using an old version of Python? Support for sort(key=fn) was added in Python 2.4. Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor