def validate(self, isin):
        """Check the length, country code and checkdigit of the isin"""
        self.check_length(isin)
        self.check_country(isin)
        try:
            if self.calc_checkdigit(isin) != int(isin[-1]):
                raise CheckdigitError("Checkdigit '%s' is not valid" % isin[-1])
        except ValueError:
                raise CheckdigitError("Checkdigit '%s' is not valid" % isin[-1])
Check the length, country code and checkdigit of the isin
recipes/Python/498277_ISIN_Validator/recipe-498277.py