Mbpp/305

⚠️ 仅 Base 通过 Base: PASS Plus: FAIL
测试评估
指标结果
Base 测试PASS
Plus 测试FAIL
代码长度687 字符
模型生成的代码 (687 字符)
def start_withp(words_list):
    """
    Given a list of strings where each string contains one or more words separated by spaces,
    return a tuple of the first two words that start with the letter 'p' (case-insensitive).
    """
    p_words = []
    for phrase in words_list:
        # Split each phrase into individual words
        for word in phrase.split():
            if word.lower().startswith('p'):
                p_words.append(word)
                # Stop as soon as we have two words
                if len(p_words) == 2:
                    return tuple(p_words)
    # If fewer than two words are found, return what we have (or handle as needed)
    return tuple(p_words)
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • [[]]