测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 529 字符 |
模型生成的代码 (529 字符)
def dog_age(human_years: int) -> float:
"""
Calculate a dog's age in dog years based on human years.
The common rule used here:
- For the first two years, each human year equals 10.5 dog years.
- After two years, each additional human year equals 4 dog years.
Args:
human_years (int): The age of the dog in human years.
Returns:
float: The dog's age in dog years.
"""
if human_years <= 2:
return human_years * 10.5
else:
return 21 + (human_years - 2) * 4
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试