Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #39607
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <ian.g.kelly@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.073 |
| X-Spam-Evidence | '*H*': 0.85; '*S*': 0.00; 'run-time': 0.05; '22,': 0.09; 'literal.': 0.16; 'subject:issue': 0.16; 'wrote:': 0.17; 'feb': 0.19; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'fixed': 0.28; 'this?': 0.28; 'probably': 0.29; 'fri,': 0.30; 'code': 0.31; 'subject:Number': 0.33; 'to:addr:python-list': 0.33; 'hi,': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'clear': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'should': 0.36; 'rather': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'provide': 0.62; 'more': 0.63; 'sounds': 0.71; '2013': 0.84; 'to:name:python': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=JsDhZB5v6P9Al0XQwAYIPNMgbAHJb3wRnGba83gGb6o=; b=rYMfo7u36sY98NMMVQFezORdXnZmK1B09HV73o/4Spigj24F+3KediJdrsDO3qoo5f nD0AU6HfqzXT1438rXMq+/8gQ2jv+Ayd4qxLbSyE0BMlSt1CM+XbOPAHRCiwOAt9qgJN U1Cz3BimVprPOmJ+qwgo3kx34k8fos+Y5anCwuEPuvYpEzXLjAjaVaK4OdPbEbA9DnYd cYYNAh+p7iVp40QC1Kz7wBysDej85JF1ir4Qbqt6lh48CL6B2HcfKnXZ6QtGXsObOflU oLL7OYJrAHds485FJrbx9qJUFyasOf2vmcqJNUXIlpNwDJA8SBAelpWIA165ev6O2bVr 4JUg== |
| X-Received | by 10.66.251.71 with SMTP id zi7mr5676492pac.153.1361559053702; Fri, 22 Feb 2013 10:50:53 -0800 (PST) |
| MIME-Version | 1.0 |
| In-Reply-To | <CAJ2vgs7yy27HhidfKCkGbqmBUtfB_dx0s_m9xK8x-ETFKjJd+Q@mail.gmail.com> |
| References | <CAJ2vgs5_gYPvMxfBUjs_6QgzUNd4akTvL2p0jV+7E-m8_6xeUw@mail.gmail.com> <CAO+9iGeOQ6jQPfNuG3TSSDK3vFGQVOuWPCgrOcMn+dtJZawj=Q@mail.gmail.com> <CAO+9iGc5bmp9iNveDQ7Bc_LcDDTX6o0rZdr8vHi1aNxYm6go5Q@mail.gmail.com> <CAJ2vgs76po_3JiuqGtLH3b=bP-U1TW-mYYtkxeU-bbx7Z2oHhw@mail.gmail.com> <CAJ2vgs4YvQ+RcKMjEnSimRE3pv3QYbuHuSeHfnU703w1QJr5Ew@mail.gmail.com> <CAJ2vgs5oX0Oxt++K8v8qHdB46ewpoLKQ9QxQX5P3u_NvypFM7g@mail.gmail.com> <CAJ2vgs7yy27HhidfKCkGbqmBUtfB_dx0s_m9xK8x-ETFKjJd+Q@mail.gmail.com> |
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | Fri, 22 Feb 2013 11:50:13 -0700 |
| Subject | Re: Number validation issue |
| To | Python <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 <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.2296.1361559056.2939.python-list@python.org> (permalink) |
| Lines | 18 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1361559056 news.xs4all.nl 6863 [2001:888:2000:d::a6]:57303 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:39607 |
Show key headers only | View raw
On Fri, Feb 22, 2013 at 11:27 AM, Morten Engvoldsen <mortenengv@gmail.com> wrote: > Hi, > Just to make it more clear: I am looking for how to generate the weight in : > 1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7.. format for any > length of number instead of > > weights = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2, 1] > > only for fixed digit. > > My below code can check only for 9 digit, so if we provide a number of more > than 9 digit, it is not able to check that number. Hope, this makes clear > what i am looking for... It sounds like you probably should generate the list of weights at run-time rather than hard-coding it as a literal. Have you tried this?
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Number validation issue Ian Kelly <ian.g.kelly@gmail.com> - 2013-02-22 11:50 -0700
csiph-web