Mbpp/773

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度473 字符
模型生成的代码 (473 字符)
def occurance_substring(string, substring):
    """
    Find the first occurrence and position of a substring within a string.
    
    Args:
        string (str): The string to search within.
        substring (str): The substring to search for.
    
    Returns:
        tuple: (substring, start_index, end_index) if found, else None.
    """
    index = string.find(substring)
    if index == -1:
        return None
    return (substring, index, index + len(substring))
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试