Mbpp/474

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度408 字符
模型生成的代码 (408 字符)
def replace_char(string: str, old_char: str, new_char: str) -> str:
    """
    Replace all occurrences of old_char with new_char in the given string.

    Args:
        string: The original string.
        old_char: The character to be replaced.
        new_char: The character to replace with.

    Returns:
        A new string with replacements made.
    """
    return string.replace(old_char, new_char)
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试