Python3 max() 函数

Python 3 教程 · 2019-02-05 13:43:21

描述

max() 方法返回给定参数的最大值,参数可以为序列。

语法

以下是 max() 方法的语法:

max( x, y, z, .... )

参数

  • x -- 数值表达式。
  • y -- 数值表达式。
  • z -- 数值表达式。

返回值

返回给定参数的最大值。

实例

以下展示了使用 max() 方法的实例:

#!/usr/bin/python3

print ("max(80, 100, 1000) : ", max(80, 100, 1000))
print ("max(-20, 100, 400) : ", max(-20, 100, 400))
print ("max(-80, -20, -10) : ", max(-80, -20, -10))
print ("max(0, 100, -400) : ", max(0, 100, -400))

以上实例运行后输出结果为:

max(80, 100, 1000) :  1000
max(-20, 100, 400) :  400
max(-80, -20, -10) :  -10
max(0, 100, -400) :  100

点击查看所有 Python 3 教程 文章: https://codercto.com/courses/l/10.html

查看所有标签

Real-Time Collision Detection

Real-Time Collision Detection

Christer Ericson / CRC Press / 2004-12-22 / USD 98.95

Written by an expert in the game industry, Christer Ericson's new book is a comprehensive guide to the components of efficient real-time collision detection systems. The book provides the tools and kn......一起来看看 《Real-Time Collision Detection》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

URL 编码/解码
URL 编码/解码

URL 编码/解码

SHA 加密
SHA 加密

SHA 加密工具