Python整数数组最大值

>>> nums = [1, 8, 2, 23, 7, -4, 18, 23, 42, 37, 2]
>>> max( nums )
42		#Max value in array
欢迎来到之路教程(on itroad-com)

查看Python 字符串数组最大值

>>> siteName = ["on","it","road","java","world"]
>>> max( siteName )
Python 如何找出数组中最大的元素

可以使用 Python max() 函数:

  • 计算在其参数中值的最大值。
  • 如果是字符串数组,则按照字典顺序排序。
日期:2020-09-17 00:10:33 来源:oir作者:oir