测试评估
| 指标 | 结果 |
|---|---|
| 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']]]