# height.py # Constants INCHES_PER_FOOT = 12 """Conversion functions between inches and feet This module shows off three functions for converting height between height_in_inches and feet_and_inches. It also shows how to use variables to represent constants: values given a name in order to remember them better.""" def to_inches(feet, inches): """Parameter feet: foot component of height Parament inches: inch component of height Returns: feet-and-inches height converted to only-inches height """ return (feet * INCHES_PER_FOOT)+inches def get_feet(height_in_inches): """Parameter height_in_inches: one's height in inches Returns: foot component of one's height""" return height_in_inches // INCHES_PER_FOOT def get_inches_left(height_in_inches): """Parameter height_in_inches: one's height in inches Returns: inches component of one's height""" return height_in_inches % INCHES_PER_FOOT