Mbpp/294

⚠️ Base 通过 / Plus 失败 Base: PASS Plus: FAIL
测试评估
指标结果
Base 测试PASS
Plus 测试FAIL
代码长度432 字符
模型生成的代码 (432 字符)
def max_val(lst):
    """
    Find the maximum numeric value in a heterogeneous list.
    The function filters out all elements that are integers or floats,
    then returns the maximum of those. If no numeric values are present,
    it returns None.
    """
    # Extract numbers (int and float) from the list
    numbers = [x for x in lst if isinstance(x, (int, float))]
    if numbers:
        return max(numbers)
    return None
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • [['3.14', False, 7.5]]