Mbpp/577

⚠️ Base 通过 / Plus 失败 Base: PASS Plus: FAIL
测试评估
指标结果
Base 测试PASS
Plus 测试FAIL
代码长度401 字符
模型生成的代码 (401 字符)
def last_Digit_Factorial(n):
    """
    Returns the last digit of n! (factorial of n).
    For n >= 5, the last digit is always 0.
    """
    if n < 0:
        raise ValueError("Factorial is not defined for negative numbers")
    if n >= 5:
        return 0
    # n is in [0, 4]; compute factorial and take last digit
    fact = 1
    for i in range(2, n + 1):
        fact *= i
    return fact % 10
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • [2.5]