[Tutor] advanced sorting
Eric Brunson
brunson at brunson.com
Tue Sep 4 21:39:06 CEST 2007
What version of python are you using?
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
>
>
> -Best Regards,
> M.srikanth.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
More information about the Tutor
mailing list