测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 607 字符 |
模型生成的代码 (607 字符)
def mul_even_odd(lst):
"""
Returns the product of the first even and the first odd number in the list.
Assumes the list contains at least one even and one odd number.
"""
first_even = None
first_odd = None
for num in lst:
if num % 2 == 0:
if first_even is None:
first_even = num
else:
if first_odd is None:
first_odd = num
# Stop early if both have been found
if first_even is not None and first_odd is not None:
break
return first_even * first_odd
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试