''' file: my_functions.py Some functions that I use a lot. Mithat Konar ''' def triangle_area(base, height): ''' Return the area of a triangle of known base and height. Parameters: base: the base of the triangle height: the height of the triangle Precondition: base and height are numeric arguments. ''' area = base * height / 2 return area def rectangle_area(width, height): ''' Return the area of a rectangle of known width and height. Parameters: width: the width of the rectangle height: the height of the rectangle Precondition: width and height are numeric arguments. ''' area = width * height return area if __name__ == '__main__': # test my functions print('Testing triangle_area:') b = 1 h = 1 area = triangle_area(b, h) print(area) b = 3.3 h = 2.2 area = triangle_area(b, h) print(area) print('Testing rectangle_area:') h = 1 w = 1 area = rectangle_area(h, w) print(area) h = 3.3 w = 2.2 area = rectangle_area(h, w) print(area)