def evaluate_increment(lower_boundary, upper_boundary): lower_boundary_height = evaluate_function(lower_boundary) upper_boundary_height = evaluate_function(upper_boundary) print ('lower_value = ', lower_boundary_height) print ('upper_value = ', upper_boundary_height) increment_area = ((lower_boundary_height + upper_boundary_height)/2) * (upper_boundary - lower_boundary) return increment_area
def evaluate_increment(lower_boundary, upper_boundary): lower_boundary_height = evaluate_function(lower_boundary) upper_boundary_height = evaluate_function(upper_boundary) print('lower_value = ', lower_boundary_height) print('upper_value = ', upper_boundary_height) increment_area = ((lower_boundary_height + upper_boundary_height) / 2) * (upper_boundary - lower_boundary) return increment_area
def test_evaluate_function(): """ the function should evaluate the expression """ assert evaluate_function(0) == 3 assert evaluate_function(3) == 12 assert evaluate_function(5) == 28