Really! Learn to use google better. I just used "python sort list"

Look at: http://wiki.python.org/moin/HowTo/Sorting

Read about list.sort. Try, at a command prompt (assuming you have a unix shell), "pydoc list"
search for sort; read it. It mentions 'reverse'.

then slice the list to your desired set and return.

sph


On 04/23/2010 07:02 AM, Grant Edwards wrote:
On 2010-04-22, D'Arcy J.M. Cain<da...@druid.net>  wrote:
On Thu, 22 Apr 2010 15:04:01 +0100
Tim Golden<m...@timgolden.me.uk>  wrote:
So please tell me if there is one or not. I really need this soon.
Appreciate a lot.
Assuming top-k doesn't mean something obscurely statistical:
You really shouldn't do people's homework for them.  It doesn't do
them any favours.
Doing people's homework for them is a survival mechanism -- it reduces
the competence of potential new rivals.  :)

OTOH, if you do end up working with one of those a new grads with a
diploma but not a clue, you end up worse off because now you have to
teach them the problem solving skills they didn't learn in school.


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to