Python 中的 max(str)函数

首页 / Python2入门教程 / Python 中的 max(str)函数

Python字符串方法max()返回字符串字符串的最大字母字符。

max(str) - 语法

max(str)
  • str  -  这是需要返回的最大字母字符的字符串。

max(str) - 返回值

此方法返回字符串中的最大字母字符。

链接:https://www.learnfk.comhttps://www.learnfk.com/python/string-max.html

来源:LearnFk无涯教程网

max(str) - 示例

以下示例显示max()方法的用法。

#!/usr/bin/python

str="this is really a string example....wow!!!";
print "Max character: " + max(str)

str="this is a string example....wow!!!";
print "Max character: " + max(str)

当无涯教程运行上面的程序时,它产生以下输出-

Max character: y
Max character: x

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

技术教程推荐

Android开发高手课 -〔张绍文〕

Redis核心技术与实战 -〔蒋德钧〕

基于人因的用户体验设计课 -〔刘石〕

陶辉的网络协议集训班02期 -〔陶辉〕

反爬虫兵法演绎20讲 -〔DS Hunter〕

大厂广告产品心法 -〔郭谊〕

中间件核心技术与实战 -〔丁威〕

Kubernetes入门实战课 -〔罗剑锋〕

深入拆解消息队列47讲 -〔许文强〕

好记忆不如烂笔头。留下您的足迹吧 :)