温馨提示×

python怎么输出列表中最大的数

小亿
90
2024-05-24 11:48:37
栏目: 编程语言

要输出列表中最大的数,可以使用内置函数`max()`来找到列表中的最大值,然后将其打印出来。例如:

```python

numbers = [10, 20, 30, 40, 50]

max_number = max(numbers)

print("The maximum number in the list is:", max_number)

```

上面的代码会输出列表`numbers`中的最大值,即`50`。

0