一、min函数

  取当前字符串的最小字符串

s1 = min(strs)

二、max函数

  取当前字符串的最大字符串

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
s1 = max(strs)

三、enumerate函数

  函数用于将一个可遍历的数据对象(如列表、元组或字符串)组合为一个索引序列,同时列出数据和数据下标,一般用在 for 循环当中。

seq = ['one', 'two', 'three']
for i, x in enumerate(seq):
    print(i,x)
'''
0 one
1 two
2 three
'''

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄