Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

confidence intervals (Chapter 4)

Answered: 1 week ago

Question

What is the purpose of the EEOC?

Answered: 1 week ago