77.3k views
2 votes
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. ex: print_total_inches(5, 8) prints: total inches: 68

2 Answers

2 votes

Answer:

2

I am taking my first programming course, so my apologies if this is a dumb question/possibly classified by the wrong category on this site. One of the exercise problems I am working on is the following:

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. Ex:

print_total_inches(5, 8) prints:

Total inches: 68

Explanation:

User Samottenhoff
by
5.0k points
0 votes

Answer:

def print_total_inches(num_feet, num_inches):

totalinches = (12*num_feet) + num_inches

print('total inches:' + str(total inches))

print_total_inches(5, 8)

Explanation:

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. ex: print_total_inches(5, 8) prints: total inches: 68

Using a python Graphic User interface we can write the following code in python.

def print_total_inches(num_feet, num_inches):

totalinches = (12*num_feet) + num_inches

print('total inches:' + str(total inches))

print_total_inches(5, 8)

User Nohus
by
5.6k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.