Ask Question

A cubit is an ancient unit of length, roughly the distance between one's fingers and elbow. The definition of one cubit is 18 inches. Write a program consisting of one script and one function. The script does the following: ▪ prompts the user for the number of cubits ▪ calls a function cubit2inch to convert this number to inches ▪ prints the result

+2
Answers (1)
  1. 12 April, 06:54
    0
    def cubit2inch (c) : inches = c * 18 print (inches) cubit = int (input ("Enter number of cubits: ")) cubit2inch (cubit)

    Explanation:

    The solution code is written in Python 3.

    Firstly, write a function cubit2inch that takes one input parameter, c. In the function, apply the formula to convert the cubit to inches and print it (Line 2 - 3).

    In the main program, we prompt user to input number of cubits and convert it to numerical and assign it to cubit variable (Line 5). Call the function to print the converted inches (Line 6).
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “A cubit is an ancient unit of length, roughly the distance between one's fingers and elbow. The definition of one cubit is 18 inches. Write ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers