Mbpp/585

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
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 失败测试用例
  • 无失败测试