The International Standard Book Number (ISBN) system is used to uniquely identify books. In a 10-digit ISBN,
Question:
The International Standard Book Number (ISBN) system is used to uniquely identify books. In a 10-digit ISBN, the first 9 digits (from left to right) x1, x2, x3, ..., x9 are each 0-9. The last (rightmost) digit x10 is known as a “check digit” and is calculated based on the first 9 such that (10x1 + 9x2 + 8x3 + 7x4 + 6x5 + 5x6 + 4x7 + 3x8 + 2x9 + x10) mod 11 = 0 The check digit can be a digit from 0-9, or the letter X, which represents 10. The check digit provides a mechanism to catch errors in the first 9 digits; many (but not all) errors can be caught this way. Write a program named isbn checker.py that allows the user to enter a 10-digit ISBN as a string. The program should then determine and show whether the number is valid according to the formula above. You may assume the user will always enter valid digits (0-9 for the first 9 digits, 0-9 or X for the last digit). If the last digit is X, ignore its case; both X and x should be considered equivalent to 10. Print an error message if the user tries to enter an ISBN that’s shorter or longer than 10 digits. Hints: Remember that you can use int() to convert string values into integers. Your code will probably be very repetitive – make liberal use of copy and paste :) (Ctrl/Command+C, Ctrl/Command+V)