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


Groups > comp.lang.python > #39607 > unrolled thread

Re: Number validation issue

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2013-02-22 11:50 -0700
Last post2013-02-22 11:50 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Number validation issue Ian Kelly <ian.g.kelly@gmail.com> - 2013-02-22 11:50 -0700

#39607 — Re: Number validation issue

FromIan Kelly <ian.g.kelly@gmail.com>
Date2013-02-22 11:50 -0700
SubjectRe: Number validation issue
Message-ID<mailman.2296.1361559056.2939.python-list@python.org>
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?

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web