For this Project you will investigate the International Standard Book Number and its check digit protocol. You will have to find the ISBN number for the book used in the class, which means you may have to read the syllabus. You may also find it useful to read up on ISBN and other check digit methods in general. If you do any external research be sure to properly cite your sources. If you work with another student(s), please include their name(s) in the write-up as well. If you use any electronic resources to help you find the ISBN or perform calculations of the check digit, be sure to name them in the report. You should also perform the check digit calculations yourself, by hand, just to check.
The check digit a13 for an ISBN-13 with initial digits a1a2...a12 is determined by the congruence (a1 + a3 + ... + a13) + 3(a2 + a4 + ... + a12) ≡ 0 (mod 10). Find the ISBN-13 for the text used in class, and (hopefully!) confirm that it is valid. Then show that the check digit of an ISBN-13 can always detect a single error. Finally, show that there are transpositions of two digits that are not detected by an ISBN-13.
The ISBN 13 is 978-0-07-338309-5
Hey following snippet of code validates the ISBN;
*******************************************************************************
def check_ISBN(num):
num = num.replace("-","")
ot,et = 0,0
for i in range(len(num)-1):
if i%2 == 0:
et += int(num[i])
else:
ot += int(num[i])
ot = 3*ot
res = (et+ot) % 10
if res == 0 and num[-1] == "0":
return True
elif (10-res) == int(num[-1]):
return True
else:
return False
print(check_ISBN("978-0-07-338309-5"))
*******************************************************************************************

For this Project you will investigate the International Standard Book Number and its check digit protocol....