Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #22159
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <michael.poeltl@univie.ac.at> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.020 |
| X-Spam-Evidence | '*H*': 0.96; '*S*': 0.00; 'subject:number': 0.09; 'random': 0.13; 'print': 0.15; 'cc:addr:python-list': 0.15; 'subject:random': 0.16; 'def': 0.20; 'header:In-Reply-To:1': 0.22; 'header:User-Agent:1': 0.23; '>>>': 0.24; 'this?': 0.24; 'cc:no real name:2**0': 0.26; 'cc:addr:python.org': 0.27; 'cc:2**0': 0.31; 'skip:( 30': 0.34; 'charset:us-ascii': 0.36; 'how': 0.40; 'content-disposition:inline': 0.62 |
| DKIM-Signature | v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=univie.ac.at; s=rev2; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=I9C2JaP2uu30A+p2KedEKl5jyEc1lMIBtkwLJ74h5ZQ=; b=mO1ujZgcGV2L1iY6YiV8+Ipf0hQ9NMN2JjXKtVHxZ6mC37zO0ekDiogMI7TPpRYvSHjU4gJ8spYvipheDwIXF9ap6BhBC/v3lYUcIezTHjn5ZnalQ77Ach0XusuN+762hMqSBEYgYLnuoL6M+kzcTw9XfnBGTr9j1i7Kfo1Cft8=; |
| Date | Mon, 26 Mar 2012 08:40:00 +0200 |
| From | Michael Poeltl <michael.poeltl@univie.ac.at> |
| To | Nikhil Verma <varma.nikhil22@gmail.com> |
| Subject | Re: random number |
| References | <CABgq=FyhR+Ldujj3YKRBpVXRVoeoayuXZviUUcNx-gXnFiHLSw@mail.gmail.com> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| In-Reply-To | <CABgq=FyhR+Ldujj3YKRBpVXRVoeoayuXZviUUcNx-gXnFiHLSw@mail.gmail.com> |
| User-Agent | Mutt/1.5.21 (2010-09-15) |
| X-Univie-Virus-Scan | scanned by ClamAV on jarvis.univie.ac.at |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| 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.980.1332744526.3037.python-list@python.org> (permalink) |
| Lines | 14 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1332744526 news.xs4all.nl 6914 [2001:888:2000:d::a6]:33191 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:22159 |
Show key headers only | View raw
* Nikhil Verma <varma.nikhil22@gmail.com> [2012-03-26 08:09]:
> Hi All
>
> How can we generate a 6 digit random number from a given number ?
what about this?
>>> given_number=123456
>>> def rand_given_number(x):
... s = list(str(x))
... random.shuffle(s)
... return int(''.join(s))
...
>>> print (rand_given_number(given_number))
653421
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Re: random number Michael Poeltl <michael.poeltl@univie.ac.at> - 2012-03-26 08:40 +0200
Re: random number Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-03-26 07:24 +0000
Re: random number Grzegorz Staniak <gstaniak@gmail.com> - 2012-03-26 07:50 +0000
Re: random number Robert Kern <robert.kern@gmail.com> - 2012-03-26 10:36 +0100
csiph-web