I\'m given some ISBN numbers e.g. 3-528-03851
(not valid) , 3-528-16419-0
(valid). I\'m supposed to write a program which tests if the ISBN number
Your check digit can take on the values 0-10, based on the fact that it's modulo-11. There's a problem with the line:
check_digit = int(isbn[-1])
as this works only for the digits 0-9. You'll need something for the case when the digit is 'X', and also for the error condition when it isn't any of the above - otherwise your program will crash.