Mbpp/740

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度428 字符
模型生成的代码 (428 字符)
def tuple_to_dict(t):
    """
    Converts a tuple to a dictionary by pairing adjacent elements as key-value pairs.
    
    Args:
        t (tuple): The input tuple. It is assumed to have an even number of elements.
    
    Returns:
        dict: A dictionary formed by taking elements at even indices as keys and 
              elements at odd indices as values.
    """
    return {t[i]: t[i+1] for i in range(0, len(t), 2)}
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试