def check_attempt(p): att = get_numerical_answer(p['att_tree']) ans = get_numerical_answer(p['ans_tree']) if att * ans < 0: return "Can the answer be negative?" return ""
def check_attempt(p): att = get_numerical_answer(p['att_tree']) ans = get_numerical_answer(p['ans_tree']) if float(ans).is_integer() and not float(att).is_integer(): return "Can the answer be fractional?" return ""