Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.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.102 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.80; '*S*': 0.00; "subject:' ": 0.07; 'subject:help': 0.08; 'latter': 0.09; 'subject:using': 0.09; 'python': 0.11; 'def': 0.12; "'n'": 0.16; 'dice': 0.16; 'marker': 0.16; 'multiples': 0.16; 'numbered': 0.16; 'subject: \n ': 0.16; 'subject:python': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'obviously': 0.18; '>>>': 0.22; 'to:name:python-list@python.org': 0.22; 'received:65.55.116': 0.24; 'recognize': 0.24; 'sort': 0.25; 'header:In-Reply-To:1': 0.27; 'skip:- 40': 0.29; 'chris': 0.29; 'am,': 0.29; 'subject:list': 0.30; 'url:mailman': 0.30; "company's": 0.31; "d'aprano": 0.31; 'steven': 0.31; 'anyone': 0.31; 'regular': 0.32; 'url:python': 0.33; 'everyone': 0.33; 'entirely': 0.33; 'date:': 0.34; 'except': 0.35; 'but': 0.35; 'add': 0.35; 'there': 0.35; 'right?': 0.36; 'up!': 0.36; 'url:listinfo': 0.36; 'url:org': 0.36; 'two': 0.37; 'list': 0.37; 'email addr:python.org': 0.37; 'to:addr:python-list': 0.38; 'subject:': 0.39; 'stock': 0.39; '\xa0\xa0\xa0': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'url:mail': 0.40; 'how': 0.40; 'most': 0.60; 'times': 0.62; "you've": 0.63; 'email addr:gmail.com': 0.63; 're:': 0.63; 'real': 0.63; '(that': 0.65; 'email name:python-list': 0.65; 'here': 0.66; 'close': 0.67; 'six': 0.68; '26,': 0.68; 'therefore': 0.72; 'eight': 0.74; 'maths': 0.84; 'received:65.55.116.40': 0.84; 'received:blu0-omc1-s29.blu0.hotmail.com': 0.84; 'twelve': 0.84; '+1000': 0.91; 'serious': 0.97; '2013': 0.98 X-TMN: [A6lV6i5fdKuoubQvBRfKgPfh/BJYtPho] X-Originating-Email: [carlosnepomuceno@outlook.com] From: Carlos Nepomuceno To: "python-list@python.org" Subject: RE: help how to sort a list in order of 'n' in python without using inbuilt functions?? Date: Sat, 25 May 2013 20:17:51 +0300 Importance: Normal In-Reply-To: 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>, , , , , , , , , <51a0ca91$0$30002$c3e8da3$5496439d@news.astraweb.com>, Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 25 May 2013 17:17:51.0954 (UTC) FILETIME=[C9A21B20:01CE596B] 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: 60 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369502281 news.xs4all.nl 15872 [2001:888:2000:d::a6]:46322 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46010 ----------------------------------------=0A= > Date: Sun=2C 26 May 2013 01:41:58 +1000=0A= > Subject: Re: help how to sort a list in order of 'n' in python without us= ing inbuilt functions??=0A= > From: rosuav@gmail.com=0A= > To: python-list@python.org=0A= >=0A= > On Sun=2C May 26=2C 2013 at 12:28 AM=2C Steven D'Aprano=0A= > wrote:=0A= >> On Sat=2C 25 May 2013 19:14:57 +1000=2C Chris Angelico wrote:=0A= >>=0A= >>> def random_number():=0A= >>> return 7=0A= >>=0A= >> I call shenanigans! That value isn't generated randomly=2C you just made= it=0A= >> up! I rolled a die *hundreds* of times and not once did it come up seven= !=0A= >=0A= > You've obviously never used a REAL set of dice. Now=2C I have here with= =0A= > me a set used for maths drill (to be entirely accurate=2C what I have=0A= > here is the company's stock of them=2C so there are multiples of each of= =0A= > these - anyone need to buy dice?) with everything except the classic 1=0A= > through 6 that everyone knows:=0A= >=0A= > * Six sides=2C faces marked 7 through 12=0A= > * Six sides=2C faces marked "+x-\xf7+" and a "wild" marker (yes=2C two of= +)=0A= > * Ten sides=2C numbered 0 through 9=0A= > * Eight sides=2C numbered 1 through 8=0A= > * Twelve sides=2C as above=0A= > * Twenty sides=2C as above=0A= >=0A= > Now=2C tabletop roleplayers will recognize the latter four as the ones=0A= > notated as d10=2C d8=2C d12=2C and d20=2C but these are NOT for gameplay= =2C they=0A= > are for serious educational purposes! Honest!=0A= >=0A= > Anyway=2C all of those can roll a 7... well=2C one of them has to roll a= =0A= > \xf7=2C but close enough right? Plus=2C if you roll 2d6 (that is=2C two= =0A= > regular six-sided dice and add them up)=2C 7 is statistically the most=0A= > likely number to come up with. Therefore it IS random.=0A= >=0A= > ChrisA=0A= > --=0A= > http://mail.python.org/mailman/listinfo/python-list=0A= =0A= =0A= def f(x):=0A= =A0=A0=A0 return x+1=0A= =0A= or you can just go:=0A= =0A= f(roll_d6())=0A= =0A= =3B) =