Python-list Digest, Vol 113, Issue 192

Morten Engvoldsen mortenengv at gmail.com
Sat Feb 23 17:47:58 EST 2013


Hi,
Okey i will change the function name :) Do you have any suggestion to
generate the weight at run time rather than hard coding it...

>
> ---------- Forwarded message ----------
> From: Dennis Lee Bieber <wlfraed at ix.netcom.com>
> To: python-list at python.org
> Cc:
> Date: Sat, 23 Feb 2013 14:03:23 -0500
> Subject: Re: Number validation issue
> On Sat, 23 Feb 2013 10:11:04 +0100, Morten Engvoldsen
> <mortenengv at gmail.com> declaimed the following in
> gmane.comp.python.general:
>
> > >
> > > Hi,
> > >
> >  Yes true, i need to generate weight at run time rather than hard coding
> it,
> > following are some solution:
> >
> > Since the max length of thenumber should be 25 and minimum should be 2 so
> > code will be in this way:
> >
> > def is_valid_isbn13(isbn13):
>
>         Isn't an ISBN13 -- by definition -- 13 digits (ignoring hyphens).
>
>         If your goal is to compute a checksum for a non-fixed length of
> data, I'd suggest changing the name of the function.
> --
>         Wulfraed                 Dennis Lee Bieber         AF6VN
>         wlfraed at ix.netcom.com    HTTP://wlfraed.home.netcom.com/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130223/d817fe67/attachment.html>


More information about the Python-list mailing list