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)