203k views
2 votes
7.2.5 Height in Meters codehs

1 Answer

5 votes

Answer:

INCHES_TO_CM = 2.54

CM_TO_METERS = 0.01

FEET_TO_INCHES = 12

def convert_height_to_meter(feet, inches):

inches_total = (feet * FEET_TO_INCHES) + inches

cm_total = inches_total * INCHES_TO_CM

meters = cm_total * CM_TO_METERS

print(str(feet)+" feet, "+str(inches)+" inches is "+str(meters)+" meters")

convert_height_to_meter(6, 4)

convert_height_to_meter(5, 8)

convert_height_to_meter(5, 2)

User Arek
by
4.2k points