Python——内置函数

一、min函数

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

s1 = min(strs)

二、max函数

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

s1 = max(strs)

三、enumerate函数

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

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

 

posted @ 2019-04-15 13:22  澄心元素  阅读(142)  评论(0编辑  收藏  举报