测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 489 字符 |
模型生成的代码 (489 字符)
def pair_wise(lst):
"""
Return a list of all pairs of consecutive items in a given list.
Args:
lst (list): Input list of elements.
Returns:
list: A list of tuples, each tuple containing a pair of consecutive elements.
"""
# If the list has less than 2 elements, return empty list
if len(lst) < 2:
return []
# Use list comprehension to pair consecutive elements
return [(lst[i], lst[i + 1]) for i in range(len(lst) - 1)]
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试