测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 479 字符 |
模型生成的代码 (479 字符)
def min_k(tuple_list, k):
"""
Find the minimum k records from a tuple list based on the second element.
Parameters:
tuple_list (list of tuples): The input list of tuples (name, value).
k (int): The number of minimum records to return.
Returns:
list of tuples: The k smallest records sorted by value.
"""
# Sort the list by the second element (value) and take the first k elements
return sorted(tuple_list, key=lambda x: x[1])[:k]
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试