测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 393 字符 |
模型生成的代码 (393 字符)
def check_type(tup):
"""
Check if all elements in the given tuple have the same data type.
Args:
tup (tuple): Input tuple.
Returns:
bool: True if all elements are of the same type, False otherwise.
"""
if not tup: # empty tuple: vacuously True
return True
first_type = type(tup[0])
return all(type(elem) == first_type for elem in tup)
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试