On Fri, Dec 26, 2008 at 1:21 AM, prasad rao wrote:
> By the way how can I view the builtin code for sort method?
Look at the source - Objects/listobject.c - starting at the comment
"Lots of code for an adaptive, stable, natural mergesort."
http://svn.python.org/view/python/trunk/Objects/listobje
"prasad rao" wrote
a=[21,56,35,47,94,12]
b=[]
for x in a:
b.append (min(a))
a.remove (min(a))
It is not Compleating .Doing only 3 rounds.Why?
Think about what is happening.
for x in a
x takes the next value of x after each iteration.
Each iteration reduces the size of a so a
"prasad rao" wrote in message
news:9e3fac840812252221pe3345bam7e3e3563e050c...@mail.gmail.com...
hello
I am trying to sort a list(I know there is a builtin sort method).
a=[21,56,35,47,94,12]
b=[]
for x in a:
b.append (min(a))
a.remove (min(a))
>>> a
[56, 47, 94]
>>> b
hello I am trying to sort a list(I know there is a builtin sort
method).
a=[21,56,35,47,94,12]
b=[]
for x in a:
b.append (min(a))
a.remove (min(a))
>>> a
[56, 47, 94]
>>> b
[12, 21, 35]
It is not Compleating .Doing only 3 rounds.Why?
By the way how can I view the builtin code