Python3 max()函数基础用法
作者:laozhang 时间:2021-04-16 06:53:26
描述
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
标签:Python3,max()
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
介绍Python的Django框架中的静态资源管理器django-pipeline
2023-11-12 00:10:35
实现asp长文章自动分页插件
2011-02-26 13:51:00
Python with用法实例
2022-09-07 19:34:05
asp函数转换xml中的实体字符[转义符]
2008-10-16 17:07:00
python3的数据类型及数据类型转换实例详解
2022-06-30 11:24:45
![](https://img.aspxhome.com/file/2023/7/65447_0s.png)
JavaScript几种弹窗事件的使用
2023-08-24 15:59:08
![](https://img.aspxhome.com/file/2023/4/56174_0s.png)
基于scrapy的redis安装和配置方法
2022-07-15 17:26:56
MySQL与PHP的基础与应用专题之自连接
2023-11-14 08:52:37
![](https://img.aspxhome.com/file/2023/3/77203_0s.png)
python使用技巧-查找文件
2021-11-10 18:48:21
基于Google的Python编码规范标准
2023-02-21 12:40:38
Mootools 1.2教程(6)——操纵HTML DOM元素
2008-11-20 13:19:00
Python变量名详细规则详细变量值介绍
2021-08-05 07:51:57
![](https://img.aspxhome.com/file/2023/9/77589_0s.png)
cv2.imread 和 cv2.imdecode 用法及区别
2023-12-03 06:15:49
Javascript语法检查插件 jsLint for Vim
2009-03-11 16:37:00
![](https://img.aspxhome.com/file/UploadPic/20093/11/medium-86s.jpg)
call在Python中改进数列的实例讲解
2021-10-12 17:17:20
Python压缩解压缩zip文件及破解zip文件密码的方法
2023-04-20 10:30:30
![](https://img.aspxhome.com/file/2023/2/65932_0s.jpg)
keras 模型参数,模型保存,中间结果输出操作
2023-06-05 09:52:33
![](https://img.aspxhome.com/file/2023/1/84921_0s.jpg)
一位网友的DIV CSS编码笔记——XieBiji
2008-09-12 12:22:00
Python基础之模块详解
2023-02-24 23:23:52
![](https://img.aspxhome.com/file/2023/2/68432_0s.png)
Python制作刷网页流量工具
2021-10-21 00:23:28