import all_constants as c def round_ans(val): """ Round a number to the nearest whole value. :param val: Value to round :return: Rounded result as a string """ return str(round(val)) def to_kilogram(to_convert): """ Convert pounds to kilograms. """ answer = to_convert * c.LB_TO_KG return round_ans(answer) def to_pounds(to_convert): """ Convert kilograms to pounds. """ answer = to_convert * c.KG_TO_LB return round_ans(answer)