def round_ans(val): """ Rounds weight to nearest :param val: Number to be rounded :return: Number Rounded to nearest degree """ var_rounded = round(val, 2) return "{:.0f}".format(var_rounded) def to_kilograms(lbs): """ Converts from pounds to kilograms :param to_convert: Weight to be converted in LBS :return: Converted weight in KG """ answer = (lbs) / 2.20462262185 return round(answer, 2) def to_pounds(kg): """ Converts from kilograms to pounds :param to_convert: Weight to be converted in KG :return: Converted temperature in LBS """ answer = kg * 2.20462262185 return round(answer, 2) # Main Routine / Testing starts here to_kg_test = [0, 100, 1] to_lbs_test = [0, 100, 1] for item in to_lbs_test: ans = to_pounds(item) print(f"{item} KG is {ans} LBS") print() for item in to_kg_test: ans = to_kilograms(item) print(f"{item} LBS is {ans} KG")