Mbpp/580

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
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 失败测试用例
  • 无失败测试