You will write the check digit method of the 13-digit ISBN and bar code, and use it to catch typing mistakes. The digits are held in a string, so each one is turned into a number with int.
Your tasks.
weighted_total, return the total of the digits of number multiplied by from the left.check_digit, return the check digit for the first twelve digits first12: the number that takes the weighted total up to a multiple of (or if it already is one).is_valid, return True if the weighted total of all digits of full is a multiple of .Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…