Hi,
i am using a macpro version(10.4.11) and python version is "2.3.5"
Message: 10
Date: Wed, 05 Sep 2007 01:00:44 +0530
From: Noufal Ibrahim <[EMAIL PROTECTED]>
Subject: Re: [Tutor] advanced sorting
To: [EMAIL PROTECTED]
Cc: tutor@python.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain;       charset=ISO-8859-1;     format=flowed

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
>
>

Seems to work fine for me. What version of Python are you using?

 >>> x=['srikanth', 'kumar', 'muppandam', 'will', 'be', 'a']
 >>> x.sort(reverse=True)
 >>> x
['will', 'srikanth', 'muppandam', 'kumar', 'be', 'a']
 >>>

--
~noufal


-- 
Best Regards,
M.Srikanth Kumar,
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to