Mbpp/632

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度579 字符
模型生成的代码 (579 字符)
def move_zero(lst):
    """
    Move all zeroes to the end of the given list.
    
    This function creates a new list where all non-zero elements
    appear in their original order, followed by all zeros.

    Args:
        lst: A list of numbers.

    Returns:
        A new list with all zeros moved to the end.
    """
    # Collect all non-zero elements in order
    non_zeros = [x for x in lst if x != 0]
    # Count how many zeros are needed
    zeros = len(lst) - len(non_zeros)
    # Return the non-zero elements followed by the zeros
    return non_zeros + [0] * zeros
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试