# Python def generate_isbn_check_digit(numbers): # Suppose that 'numbers' is 12-digit numeric string sum = 0; for i, number in enumerate(numbers): if i%2 == 0: sum += int(number) * 1 else: sum += int(number) * 3 return 10 - sum % 10
Character | Left(Odd) | Left(Even) | Right |
0 | 0001101 | 0100111 | 1110010 |
1 | 0011001 | 0110011 | 1100110 |
2 | 0010011 | 0011011 | 1101100 |
3 | 0111101 | 0100001 | 1000010 |
4 | 0100011 | 0011101 | 1011100 |
5 | 0110001 | 0111001 | 1001110 |
6 | 0101111 | 0000101 | 1010000 |
7 | 0111011 | 0010001 | 1000100 |
8 | 0110111 | 0001001 | 1001000 |
9 | 0001011 | 0010111 | 1110100 |