Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #46010

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

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 <carlosnepomuceno@outlook.com>
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 <carlosnepomuceno@outlook.com>
To "python-list@python.org" <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 <CAPTjJmpWeG3xRqKSXuH1+SwLTJhi-S=USU8cmXaQHFmgib=iyw@mail.gmail.com>
References <CAPTjJmpWeG3xRqKSXuH1+SwLTJhi-S=USU8cmXaQHFmgib=iyw@mail.gmail.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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2141.1369502281.3114.python-list@python.org> (permalink)
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

Show key headers only | View raw


----------------------------------------
> 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: rosuav@gmail.com
> To: python-list@python.org
>
> On Sun, May 26, 2013 at 12:28 AM, Steven D'Aprano
> <steve+comp.lang.python@pearwood.info> 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
> --
> http://mail.python.org/mailman/listinfo/python-list


def f(x):
    return x+1

or you can just go:

f(roll_d6())

;) 		 	   		  

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

help how to sort a list in order of 'n' in python without using inbuilt functions?? lokeshkoppaka@gmail.com - 2013-05-24 01:04 -0700
  Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Chris Angelico <rosuav@gmail.com> - 2013-05-24 18:12 +1000
  Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Dave Angel <davea@davea.name> - 2013-05-24 08:33 -0400
  RE: help how to sort a list in order of 'n' in python without using inbuilt functions?? Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-24 16:06 +0300
  Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? lokeshkoppaka@gmail.com - 2013-05-24 22:15 -0700
    Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Chris Angelico <rosuav@gmail.com> - 2013-05-25 15:24 +1000
      Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? lokeshkoppaka@gmail.com - 2013-05-24 22:39 -0700
        Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Chris Angelico <rosuav@gmail.com> - 2013-05-25 15:43 +1000
        Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-25 05:57 +0000
          Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? lokeshkoppaka@gmail.com - 2013-05-24 23:05 -0700
            Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Chris Angelico <rosuav@gmail.com> - 2013-05-25 16:12 +1000
            RE: help how to sort a list in order of 'n' in python without using inbuilt functions?? Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-25 10:53 +0300
            Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Chris Angelico <rosuav@gmail.com> - 2013-05-25 18:28 +1000
            RE: help how to sort a list in order of 'n' in python without using inbuilt functions?? Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-25 11:43 +0300
            Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Chris Angelico <rosuav@gmail.com> - 2013-05-25 18:47 +1000
            RE: help how to sort a list in order of 'n' in python without using inbuilt functions?? Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-25 11:54 +0300
            Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Chris Angelico <rosuav@gmail.com> - 2013-05-25 19:01 +1000
            RE: help how to sort a list in order of 'n' in python without using inbuilt functions?? Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-25 12:10 +0300
            Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Chris Angelico <rosuav@gmail.com> - 2013-05-25 19:14 +1000
              Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-25 14:28 +0000
                Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Fábio Santos <fabiosantosart@gmail.com> - 2013-05-25 15:46 +0100
                Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-25 16:03 +0100
                Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Chris Angelico <rosuav@gmail.com> - 2013-05-26 01:41 +1000
                Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-26 03:09 +0000
                Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Chris Angelico <rosuav@gmail.com> - 2013-05-26 14:02 +1000
                RE: help how to sort a list in order of 'n' in python without using inbuilt functions?? Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-25 20:12 +0300
                RE: help how to sort a list in order of 'n' in python without using inbuilt functions?? Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-25 20:17 +0300
                Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Chris Angelico <rosuav@gmail.com> - 2013-05-26 03:23 +1000
                Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-26 03:38 +0000
                Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Dan Sommers <dan@tombstonezero.net> - 2013-05-26 04:06 +0000
                Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Chris Angelico <rosuav@gmail.com> - 2013-05-26 14:28 +1000
                RE: help how to sort a list in order of 'n' in python without using inbuilt functions?? Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-25 20:34 +0300
            RE: help how to sort a list in order of 'n' in python without using inbuilt functions?? Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-25 12:30 +0300
            Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-25 13:01 +0100
            Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Roy Smith <roy@panix.com> - 2013-05-25 10:03 -0400
              Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Dave Angel <davea@davea.name> - 2013-05-25 10:27 -0400
            Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-25 14:30 +0000
            RE: help how to sort a list in order of 'n' in python without using inbuilt functions?? Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-25 20:07 +0300
            RE: help how to sort a list in order of 'n' in python without using inbuilt functions?? Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-25 20:45 +0300
    Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? rusi <rustompmody@gmail.com> - 2013-05-24 22:43 -0700
    Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Roy Smith <roy@panix.com> - 2013-05-25 09:29 -0400
      Re: help how to sort a list in order of 'n' in python without using inbuilt functions?? Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-05-25 17:59 +0300

csiph-web