Mbpp/222

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度403 字符
模型生成的代码 (403 字符)
def check_type(tup):
    """
    Check if all the elements in a tuple have the same data type.
    
    Args:
        tup (tuple): The input tuple.
    
    Returns:
        bool: True if all elements have the same type, False otherwise.
    """
    if not tup:  # Empty tuple: vacuously True
        return True
    first_type = type(tup[0])
    return all(isinstance(elem, first_type) for elem in tup)
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试