测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | FAIL |
| 代码长度 | 371 字符 |
模型生成的代码 (371 字符)
def count_first_elements(tup):
"""
Returns the number of elements that occur before the first tuple element
in the given tuple. If no tuple element is found, returns -1.
Example:
>>> count_first_elements((1, 5, 7, (4, 6), 10))
3
"""
for i, elem in enumerate(tup):
if isinstance(elem, tuple):
return i
return -1
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
[[1, 2, 3, 4, 5, 6]]