Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Challenge ISBN: The book industry uses ISBNs (international Standard Book Numbers) to identify books. In 2007, the industry switched from 10-digit ISBNs to 13-digit ISBNs.

image text in transcribed

Challenge ISBN: The book industry uses ISBNs (international Standard Book Numbers) to identify books. In 2007, the industry switched from 10-digit ISBNs to 13-digit ISBNs. The last digit in the ISBN-10 and the ISBN-13 is the check digit. But the algorithms for calculating the check digit are different for ISBN-10 and ISBN-13. In ISBN-13, the check digit is calculated the way like UPC, only the first digit from left is added to the sum, the second digit from left is multiplied by 3, and so on. ISBN-13 is obtained from ISBN-10 by appending '978' at the beginning and recalculating the check digit. Write a Python function isbn_13_checkdigit that calculates and returns the ISBN-13 check digit (a single character) for a given string of 12 digits, and another function, isbn10_to_isbn13 that converts ISBN-10 to ISBN-13 and returns a string of 13 digits. Test your functions thoroughly. Use the below test data. ISBN-10 0982477503 0982477511 098247752X 0982477538 0982477546 0982477554 0982477562 0982477570 0982477589 0982477597 ISBN-13 9780982477502 9780982477519 9780982477526 9780982477533 9780982477540 9780982477557 9780982477564 9780982477571 9780982477588 9780982477595 You function should get the number from the user instead of being hard coded

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions