Mbpp/591

❌ 均未通过 Base: FAIL Plus: FAIL
测试评估
指标结果
Base 测试FAIL
Plus 测试FAIL
代码长度340 字符
模型生成的代码 (340 字符)
def swap_List(lst):
    """Interchange the first and last elements of a list.

    Returns a new list with the first and last elements swapped.
    If the list has fewer than two elements, it returns a copy unchanged.
    """
    if len(lst) < 2:
        return lst[:]  # return a copy for consistency
    swapped = lst[:]          # create
Base 失败测试用例
  • [[12, 35, 9, 56, 24]]
Plus 失败测试用例
  • [[4, 'apple', 6.5, True, ['a', 'b', 'c']]]