Question: IN PYTHON #As you know, every book has an unique ISBN number (International Standard Book Number). #It is a 10-digit (or 13) code that uniquely

IN PYTHON

#As you know, every book has an unique ISBN number (International Standard Book Number). #It is a 10-digit (or 13) code that uniquely specifies a book. Since this number is long, the right most digit is actually a "checksum" #to roughly check if all the digits are correct (not mis-typed etc.) and forming a legit ISBN number. (checksum is also used in other places, like credit card number.) #The rule is: when adding all the (10 numbers * its position (rightmost be position 1, leftmost be 10)) together, the sum should be divisible by 11. #For example: ISBN 020131452-5 is legit since: # (0*10 + 2*9 + 0*8 + 1*7 + 3*6 + 1*5 + 4*4 + 5*3 + 2*2 + 5*1)%11 = 88%11 = 0 the sum 88 is divisible by 11 #In fact, the cool thing is that the checksum (rightmost 5) is the only single digit number that can satisfy this rule. In other words, if you know the first #9 digit, you can calculate the checksum (last digit). In this problem, you will be calculte the checksum of an ISBN number. ######### ''' ''' Helper function 1: check_legit_ISBN Input: a list with 10 single digit number in it Output: return "Legit" if the 10 digits form a legit ISBN number return "Not Legit" otherwise

Sample: [0,2,0,1,3,1,4,5,2,5] should return "Legit" [0,2,0,1,3,1,4,5,2,3] should return "Not Legit"

''' #def check_legit_ISBN(ISBNLis):

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!