Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.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.059 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; "subject:' ": 0.07; 'subject:help': 0.08; 'latter': 0.09; 'subject:using': 0.09; 'def': 0.12; 'dice': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 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; 'recognize': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'subject:list': 0.30; 'message-id:@mail.gmail.com': 0.30; "company's": 0.31; "d'aprano": 0.31; 'steven': 0.31; 'anyone': 0.31; 'regular': 0.32; 'everyone': 0.33; 'entirely': 0.33; 'except': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'there': 0.35; 'right?': 0.36; 'up!': 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'stock': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'most': 0.60; 'times': 0.62; "you've": 0.63; 'real': 0.63; '(that': 0.65; 'here': 0.66; 'close': 0.67; 'six': 0.68; '26,': 0.68; 'therefore': 0.72; 'eight': 0.74; 'maths': 0.84; 'twelve': 0.84; 'serious': 0.97; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=d03vGKnExGHRPrexMzlG1zGo35Cv6gjM/R/UwHl8tBA=; b=eU5AkyrnUtRaWYhlO2SonAvw6R5ouSzrIEa2uscFimmXTi6KxOkBtXfsQERQOqOebd 5ykKZ1tS28h7oJrkjGXkqgWkDHt4mqlvZ6LSHtZWSQTki/5UaDxVf9RLA22v8IczAn8b lfGeT5tPy9j7x5cauagw3FSgyvN/s5+mcATl/tJMudePhwyj1BNzs0+ISmg5ceYby8oE GztqKsIIgvyMOSm4zbbtJK/11muYIOuoSZmVyhLWohNABiA2uEMPi4c1IyHaTV3n9Upf 5nFWByb6uqpll3z1tnoBsqarqCI/m8aM1BnCFemQsGHWEqvu239bfKaDU6HGtraqvkRl HxuA== MIME-Version: 1.0 X-Received: by 10.220.167.69 with SMTP id p5mr11329341vcy.57.1369496518280; Sat, 25 May 2013 08:41:58 -0700 (PDT) In-Reply-To: <51a0ca91$0$30002$c3e8da3$5496439d@news.astraweb.com> 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> Date: Sun, 26 May 2013 01:41:58 +1000 Subject: Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369496527 news.xs4all.nl 15909 [2001:888:2000:d::a6]:53278 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46005 On Sun, May 26, 2013 at 12:28 AM, Steven D'Aprano wrote: > On Sat, 25 May 2013 19:14:57 +1000, Chris Angelico wrote: > >> def random_number(): >> return 7 > > I call shenanigans! That value isn't generated randomly, you just made it > up! I rolled a die *hundreds* of times and not once did it come up seven! You've obviously never used a REAL set of dice. Now, I have here with me a set used for maths drill (to be entirely accurate, what I have here is the company's stock of them, so there are multiples of each of these - anyone need to buy dice?) with everything except the classic 1 through 6 that everyone knows: * Six sides, faces marked 7 through 12 * Six sides, faces marked "+x-\xf7+" and a "wild" marker (yes, two of +) * Ten sides, numbered 0 through 9 * Eight sides, numbered 1 through 8 * Twelve sides, as above * Twenty sides, as above Now, tabletop roleplayers will recognize the latter four as the ones notated as d10, d8, d12, and d20, but these are NOT for gameplay, they are for serious educational purposes! Honest! Anyway, all of those can roll a 7... well, one of them has to roll a \xf7, but close enough right? Plus, if you roll 2d6 (that is, two regular six-sided dice and add them up), 7 is statistically the most likely number to come up with. Therefore it IS random. ChrisA