help how to sort a list in order of 'n' in python without using inbuilt functions??

Carlos Nepomuceno carlosnepomuceno at outlook.com
Sat May 25 04:54:53 EDT 2013


lol

def absolute(x):
    return x if x>0 else -x

def reach(x):
    y=[]
    z=0
    while z<x:
        y.append(z)
        z+=1
    return y

----------------------------------------
> Date: Sat, 25 May 2013 18:47:24 +1000
> Subject: Re: help how to sort a list in order of 'n' in python without using inbuilt functions??
> From: rosuav at gmail.com
> To: python-list at python.org
>
> On Sat, May 25, 2013 at 6:43 PM, Carlos Nepomuceno
> <carlosnepomuceno at outlook.com> wrote:
>> ----------------------------------------
>> lol I forgot to include this monkey patch! ;)
>>
>> def length(l):
>> x=0
>> y=l[:]
>> while y:
>> x+=1
>> y.pop()
>> return x
>
> Nice. Now eliminate abs (easy) and range. :)
>
> ChrisA
> --
> http://mail.python.org/mailman/listinfo/python-list 		 	   		  


More information about the Python-list mailing list