测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 595 字符 |
模型生成的代码 (595 字符)
def recursive_list_sum(lst):
"""
Recursively flattens a nested list/tuple structure and sums all its numeric elements.
Args:
lst: A list or tuple possibly containing nested lists/tuples and numbers.
Returns:
The sum of all numbers in the flattened structure.
"""
total = 0
for element in lst:
if isinstance(element, (list, tuple)):
total += recursive_list_sum(element)
else:
# Assuming the element is a number; it could be cast to int/float if needed.
total += element
return total
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试