[EMAIL PROTECTED] schrieb:
> hello,
> 
> I'm new to python and this list.I hope this question don't repeat an old 
> story on the list.
> 
> I have a number list,say it's [3,2,1,4,5],I want to sort it as 
> [1,2,3,4,5],how to do?

your_list.sort()

Please read the documentation, all of this is properly documented.

And even google would have brought that up really fast:

google:python list sort

1) http://xahlee.org/perl-python/sort_list.html (Oh my, it's Xah....)

2) http://docs.python.org/lib/typesseq-mutable.html (official python docs)


So the first two links give you all the information you needed.

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list
  • sort a list _nospamnet_
    • Re: sort a list Diez B. Roggisch

Reply via email to