Integers with leading zeroes

alister alister.nospam.ware at
Fri Jul 24 15:16:03 CEST 2015

On Wed, 22 Jul 2015 20:11:47 -0600, Michael Torrie wrote:

> On 07/22/2015 07:51 AM, Grant Edwards wrote:
>> On 2015-07-22, Ben Finney <ben+python at> wrote:
>>> Laura Creighton <lac at> writes:
>>>> The biggest use I have for decimal numbers that begin with 0 is in
>>>> credit card numbers, account numbers and the like where the first
>>>> check you do is 'does this thing have the correct number of digits'.
>>> The following are examples of types from the real world that people
>>> think of, and casually discuss, as “numbers”.
>>> * Postal code * Credit card number * Telephone number * Car
>>> registration plate number * Personal Identification Number (PIN)
>> Those are all strings.  Not numbers.
> That depends.  A credit card number is indeed a number, and there are
> mathematical formulas for determining if a particular number is a valid
> (as in well-formed) credit card number, and possibly to identify what
> kind of card it is.

no it is a string,that happens to be made up out of digits.
the digits can be manipulated but you do not perform maths on a credit 
card number as a whole


More information about the Python-list mailing list