Mbpp/65

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