测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 440 字符 |
模型生成的代码 (440 字符)
def odd_position(nums):
"""
Check whether every element at an odd index (0-based) is an odd number.
Args:
nums (list): List of integers.
Returns:
bool: True if all elements at odd indices are odd, False otherwise.
"""
for i in range(1, len(nums), 2): # odd indices: 1, 3, 5, ...
if nums[i] % 2 == 0: # even number found -> fail
return False
return True
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试