Question: IN PYTHON ''' Helper func 3: checksum_ISBN Input: a list with 9 single digit number in it (first 9 digit in ISBN) Output: print out:
IN PYTHON
''' Helper func 3: checksum_ISBN Input: a list with 9 single digit number in it (first 9 digit in ISBN) Output: print out: "The correct checksum digit is:__. Now we have a legit ISBN: _____" Hint: just loop through 0-9, test every one with helper func1 to find out the one checksum that forms a legit ISBN with the correct ISBN in lis (10 numbers), call helper func2 to format it correctly. Then print the final result. ''' #def checksum_ISBN(partISBN):
------------------------------------------------------------------------------------------------------------------------------------------------
function1:
def check_legit_ISBN(ISBNLis): size = len(ISBNLis) total = 0 for ch in ISBNLis: value = int(ch) total += value * size size -= 1 if total % 11 == 0: return "Legit" else: return "Not Legit" ------------------------------------------------------------
function 2:
def format_ISBN(ISBNLis): i=0
res="ISBN "
#appending the digits from the list
while(i<9):
res=res+str(ISBNLis[i])
i=i+1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
