1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
N76 [4]
2 years ago
10

python If the checksum is 10, the last digit is denoted as X according to the ISBN-10 convention. Write a program that prompts t

he user to enter the first 9 digits and displays the 10-digit ISBN (including leading zeros).
Computers and Technology
1 answer:
aksik [14]2 years ago
3 0

Answer:

PYTHON CODE:

str = input("Enter the first 9 digits of an ISBN-10 as a string : ") # user input

i = 1

checksum = 0 # for total sum

while i < 10:

c = int(str[i - 1]) # getting every digit of the ISBN

c = c * i

checksum += c

i=i+1

checksum=checksum % 11 # getting the last digit of ISBN

ch=checksum

if checksum==10: # if the last digit is 10 then change it to X

ch="X"

print("The Complete 10-Digit ISBN is : ",end="")

print(str,end="") # displaying the 9 digit of ISBN

print(ch) # appending the last digit of ISBN

Explanation:

You might be interested in
What is the relation between Information and Data?
Rudiy27

Answer:

In a sentence: data is raw numbers, while information is organized data.

Explanation:

Data is a series of numbers or facts.  A data set is a collection of data that are related (for examples all the students result in your last math exam).  But it's not organized by itself... and rarely mean anything when looked at it in a raw manner.

To make sense of a data collection, you have to analyze it, calculate the mean or median of the data set for example... this is a treatment that has to be done to a data set to give it significance.. after such analysis, the result you have (mean, median, etc..) is a piece of information devired from the data.

3 0
3 years ago
Who is the father of computer?​
bagirrra123 [75]

Answer:

The first automatic digital computer has been designed by the English mathematician and inventor Charles Babbage. Babbage developed the Analytical Engine Plans for the mid-1830s.

Explanation:

  • Babbage has developed the concept of a digital, programmable computer and was a mathematician, philosopher, inventor, and mechanical engineer.
  • Some regard Babbage as a "computer father"
  • The inventing of its first mechanical computer, the difference engine, is attributable to Babbage, which eventually resulted in more complex electronic designs, although Babbage's Analytical Engine is the main source of ideas for modern computers. He was described as the "prime" among the numerous polymaths of his century by his varied work in another field.
7 0
2 years ago
There's an App for That!
AleksandrR [38]

Answer:

Im confused man

Explanation:

6 0
3 years ago
Explain why you will not do these things when driving.<br><br>yall got one more time to delete it
sesenic [268]
Don't text and drive you could crash
5 0
2 years ago
From the binary search algorithm, it follows that every iteration of the while loop cuts the size of the search list by half.
Colt1911 [192]

Answer:

True: In binary search algorithm, we follow the below steps sequentially:

Input: A sorted array  B[1,2,...n] of n items and one item x to be searched.

Output: The index of x in B if exists in B, 0 otherwise.

  1. low=1
  2. high=n
  3. while( low < high )
  4.  {      mid=low + (high-low)/2
  5.         if( B[mid]==x)
  6.          {
  7.             return(mid)  //returns mid as the index of x
  8.           }
  9.          else
  10.          {
  11.              if( B[mid] < x)      //takes only right half of the array
  12.               {
  13.                 low=mid+1
  14.               }
  15.              else               // takes only the left half of the array
  16.               {
  17.                high=mid-1
  18.               }
  19.           }
  20.  }
  21. return( 0 )

Explanation:

For each iteration the line number 11 or line number 15 will be executed.

Both lines, cut the array size to half of it and takes as the input for next iteration.

6 0
3 years ago
Other questions:
  • In which setting would you be least likely to find a full-time A/V technician?
    5·2 answers
  • divide the input array into thirds (rather than halves), recursively sort each third, and finally combine the results using a th
    15·1 answer
  • Consider the provided C++ code in the main.cpp file: The function func2 has three parameters of type int, int, and double, say a
    8·1 answer
  • Is it better to meet online or offline<br> (Please answer QUICK)<br><br> Thanks :')
    5·2 answers
  • What should be used to clean LCD monitors? Liquid window cleaner Ammonia wipes Windshield washer liquid Antistatic monitor wipes
    15·1 answer
  • At the aquarium Grandma Simpson hugged the dolphin is that passive or active sentence​?
    6·1 answer
  • Why is it important to study in a quiet well lit area
    5·2 answers
  • Select the correct answer.
    15·1 answer
  • 6
    9·1 answer
  • __________ is a broad class of software that is surreptitiously installed on a user's machine to intercept the interaction betwe
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!