(self, num)
return (checksum % 10) == 0
Determine whether num is valid. Meant to be used in constrains
        Params:
            num (str or int): Number to validate using Luhn's Alg.
        Returns:
            bool
Determine whether num is valid. Meant to be used in constrains
        Params:
            num (str or int): Number to validate using Luhn's Alg.
        Returns:
            bool
Determine whether num is valid . Meant to be used in constrains Params : num ( str or int ) : Number to validate using Luhn s Alg . Returns : bool
def _luhn_is_valid(self, num):
        """ Determine whether num is valid. Meant to be used in constrains
        Params:
            num (str or int): Number to validate using Luhn's Alg.
        Returns:
            bool
        """

        if not num:
            return False

        def digits_of(n):
            return [int(d) for d in str(n)]

        digits = digits_of(num)
        odd_digits = digits[-1::-2]
        even_digits = digits[-2::-2]
        checksum = sum(odd_digits)
        checksum += sum(
            sum(digits_of(d * 2)) for d in even_digits
        )
        return (checksum % 10) == 0
def _luhn_is_valid ( self , num ) : if not num : return False def digits_of ( n ) : return [ int ( d ) for d in str ( n ) ] digits = digits_of ( num ) odd_digits = digits [ - 1 : : - 2 ] even_digits = digits [ - 2 : : - 2 ] checksum = sum ( odd_digits ) checksum += sum ( sum ( digits_of ( d * 2 ) ) for d in even_digits ) return ( checksum % 10 ) == 0