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
zlopas [31]
4 years ago
8

Define a function print_total_inches, with parameters num_feet and num_inches, that prints the total number of inches. Note: The

re are 12 inches in a foot. Sample output with inputs: 58 Total inches: 68 def print_total_inches (num_feet, hum_inches): 2 str1=12 str2=num_inches 4 print("Total inches:',(num_feet*strl+str2)) 5 print_total_inches (5,8) 6 feet = int(input) 7 inches = int(input) 8 print_total_inches (feet, inches)
Computers and Technology
1 answer:
jeka944 years ago
6 0

I'll pick up your question from here:

<em>Define a function print_total_inches, with parameters num_feet and num_inches, that prints the total number of inches. Note: There are 12 inches in a foot. </em>

<em>Sample output with inputs: 5 8 </em>

<em>Total inches: 68</em>

<em />

Answer:

The program is as follows:

def print_total_inches(num_feet,num_inches):

     print("Total Inches: "+str(12 * num_feet + num_inches))

print_total_inches(5,8)

inches = int(input("Inches: "))

feet = int(input("Feet: "))

print_total_inches(feet,inches)

Explanation:

<em>This line defines the function along with the two parameters</em>

def print_total_inches(num_feet,num_inches):

<em>This line calculates and prints the equivalent number of inches</em>

     print("Total Inches: "+str(12 * num_feet + num_inches))

The main starts here:

<em>This line tests with the original arguments from the question</em>

print_total_inches(5,8)

<em>The next two lines prompts user for input (inches and feet)</em>

inches = int(input("Inches: "))

feet = int(input("Feet: "))

<em>This line prints the equivalent number of inches depending on the user input</em>

print_total_inches(feet,inches)

You might be interested in
The PadRight function has two parameters: S (a string) and N (an int), and returns as its result the string S padded on the righ
oee [108]

Answer:

The following code is written in python programming language:

def PadRight(S,N):   #define user defined function

 if(len(S)<N):    # set if condition

   S=S.ljust(N)   #set the space to right

   return S       # return the result

 

def PadLeft(S,N):    #define user defined function

 if(len(S)<N):    # set if condition

   S=S.rjust(N)   # set the space to left

   return S       # return the result

'''calling the function'''

print(PadLeft("Frog",7))

print(PadRight("Frog",7))

Output:

      Frog

Frog

Explanation:

Here, we define a user defined function "PadRight()" and pass two arguments in its parameter "S", "N".

Then, set the if condition and pass condition "len(S)<N" then, if the condition is true then the code inside the if condition set the space to right then, return the output.

After that, we again define a user defined function "PadLeft()" and pass two arguments in its parameter "S", "N".

Then, set the if condition and pass condition "len(S)<N" then, if the condition is true then the code inside the if condition set the space to right then, return the output.

6 0
3 years ago
How do you find binary?
trasher [3.6K]

Answer:

To convert integer to binary, start with the integer in question and divide it by 2 keeping notice of the quotient and the remainder. Continue dividing the quotient by 2 until you get a quotient of zero. Then just write out the remainders in the reverse order.

Explanation:

3 0
3 years ago
Which term is used to define the wires on a motherboard that move data from one part of a computer to another?
mafiozo [28]
The answer to this question is the term bus. The term bus in computers is a communication system that transfers data and information in the computer to another computer. The bus are parallel wires that can be either optical or fiber that are connected in multiple switched hubs.
4 0
4 years ago
Why is this happening when I already uploaded files to my drive?
lara31 [8.8K]

Answer:

u have to upload it to your drive first

Explanation:

7 0
2 years ago
द्विआधार जोड गर (Binary<br>addition):<br>-<br>(i) 1012 + 1112<br>(ii) 1112 + 100​
fenix001 [56]

Answer:

1.2124

2.1212 is the correct answer right

4 0
3 years ago
Other questions:
  • true or false? to change document properties, first tap or click file on the ribbon to open the properties view.
    6·2 answers
  • Microsoft access does not create n:m relationships because microsoft access creates databases based on
    7·1 answer
  • Sam and Ella are arguing in the cafeteria. Sam says that if he throws a chicken tender with a greater speed, it will have a grea
    7·2 answers
  • A seven-octet pattern of alternating 0s and 1s used by the receiver to establish bit synchronization is a _______
    11·1 answer
  • Ann wants to save her presentation so she can work on it later. Which device on her computer can store this data long term?
    15·2 answers
  • Intelligence is to creativity as _____ is to _____. Group of answer choices spatial intelligence; musical intelligence correct t
    15·1 answer
  • Suppose that we are using PDDL to describe facts and actions in a certain world called JUNGLE. In the JUNGLE world there are 4 p
    7·1 answer
  • Que se puede observar en el escritorio de windows
    8·1 answer
  • To lose weight, you must _______.
    10·2 answers
  • In designing a database, a database administrator should consider..
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!