Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!news2.euro.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; "subject:' ": 0.07; 'subject:help': 0.08; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:using': 0.09; 'def': 0.12; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject: \n ': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'url:moin': 0.24; 'header:X-Complaints-To:1': 0.27; 'header :In-Reply-To:1': 0.27; 'function': 0.29; 'subject:list': 0.30; 'url:wiki': 0.31; 'lists': 0.32; 'another': 0.32; 'url:python': 0.33; 'add': 0.35; 'url:org': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'called': 0.40; 'read': 0.60; "you're": 0.61; 'charset:windows-1252': 0.65; 'received:89': 0.85; 'carlos': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Date: Sat, 25 May 2013 13:01:06 +0100 References: , <78192328-b31b-49d9-9cd6-ec742c092a29@googlegroups.com>, , <39ac7437-857e-483f-998c-8162c1039933@googlegroups.com>, <51a052d1$0$6599$c3e8da3$5496439d@news.astraweb.com>, <74e33270-a79a-4878-a400-8a6cda6637b2@googlegroups.com>, , , , Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: host-89-240-174-199.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 In-Reply-To: X-Antivirus: avast! (VPS 130525-0, 25/05/2013), Outbound message X-Antivirus-Status: Clean X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369483263 news.xs4all.nl 15950 [2001:888:2000:d::a6]:44735 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45988 On 25/05/2013 09:54, Carlos Nepomuceno wrote: > lol > > def absolute(x): > return x if x>0 else -x > > def reach(x): > y=[] > z=0 > while z y.append(z) > z+=1 > return y > In my book this is another fail as lists are inbuilt (yuck!) and so is the add function that'll be called for z+=1. -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence