第26752题 单选题
关于给定Python求最大值函数的算法说法错误的是?

给定Python求最大值函数代码如下:

def find_max(nums):
    if not nums:
        raise ValueError("输入数组不能为空")
    max_value = nums[0]
    for i in nums:
        if max_value < i:
            max_value = i
    return max_value

print(find_max([1,2,2,11,21,1,2,3]))
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析