Mbpp/253

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度387 字符
模型生成的代码 (387 字符)
def count_integer(lst):
    """
    Return the number of integer elements in the given list.

    This function uses isinstance(x, int) to check for integers.
    Note: In Python, bool is a subclass of int, so True and False will also be counted as integers.
    If you need to exclude booleans, replace with `type(x) is int`.
    """
    return sum(1 for x in lst if isinstance(x, int))
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试