checkdigit.isbn.missing¶
- checkdigit.isbn.missing(data: str) str [source]¶
Calculates a missing digit in an ISBN Code represented by a question mark.
- Parameters:
data – A string of characters representing a full ISBN code with a question mark representing a missing character
- Returns:
The missing value that should’ve been where the question mark was
- Return type:
str
Examples
>>> from checkdigit import isbn >>> # ISBN-10 >>> isbn.missing("15688?111X") '1' >>> # ISBN-13 >>> isbn.missing("978186197876?") '9' >>> isbn.missing("023456789128") 'Invalid'