测试评估
| 指标 | 结果 |
|---|---|
| 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]]