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


Groups > comp.lang.python > #39702

Re: Number validation issue

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: Number validation issue
Date 2013-02-23 14:03 -0500
Organization > Bestiaria Support Staff <
References <CAJ2vgs5_gYPvMxfBUjs_6QgzUNd4akTvL2p0jV+7E-m8_6xeUw@mail.gmail.com> <CAJ2vgs4ZmXkTMAOQORXWCNFLehAbLNeOMqNG1aUPFcucrTdXtw@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2369.1361646214.2939.python-list@python.org> (permalink)

Show all headers | View raw


On Sat, 23 Feb 2013 10:11:04 +0100, Morten Engvoldsen
<mortenengv@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@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

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


Thread

Re: Number validation issue Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-02-23 14:03 -0500

csiph-web