Mbpp/222

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度393 字符
模型生成的代码 (393 字符)
def check_type(tup):
    """
    Check if all elements in the given tuple have the same data type.

    Args:
        tup (tuple): Input tuple.

    Returns:
        bool: True if all elements are of the same type, False otherwise.
    """
    if not tup:  # empty tuple: vacuously True
        return True
    first_type = type(tup[0])
    return all(type(elem) == first_type for elem in tup)
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试