测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 582 字符 |
模型生成的代码 (582 字符)
def mul_even_odd(lst):
"""
Returns the product of the first even and first odd number in the given 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 and first_even is None:
first_even = num
elif num % 2 != 0 and 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 失败测试用例
- 无失败测试