最大值最小值

课程:Python · 编程练习

Python编程练习 - 最大值最小值

练习内容

# 找出列表中的最大值和最小值\ndef find_max_min(numbers):\n max_num = numbers[0]\n min_num = numbers[0]\n\n for num in numbers:\n if num > max_num:\n max_num = num\n if num < min_n