测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 572 字符 |
模型生成的代码 (572 字符)
def extract_even(tup):
"""
Recursively remove odd integers from a nested tuple, preserving the structure.
"""
result = []
for item in tup:
if isinstance(item, tuple):
# Recursively process nested tuple
processed = extract_even(item)
# Always include the processed tuple (even if empty)
result.append(processed)
elif isinstance(item, int) and item % 2 == 0:
# Keep even integers
result.append(item)
# Odd integers are simply ignored
return tuple(result)
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试