测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 412 字符 |
模型生成的代码 (412 字符)
def expensive_items(items, n):
"""
Return the n most expensive items from a list of item dictionaries.
Each item is expected to have 'name' and 'price' keys.
The result is sorted by price in descending order.
"""
# Sort the items by price in descending order
sorted_items = sorted(items, key=lambda x: x['price'], reverse=True)
# Return the top n items
return sorted_items[:n]
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试