Built-in functions that can be used by Python sequences
Enumerate (ITER)
Takes an iterator object as a parameter, returning an enumerate (traversed) object.
#!/usr/bin/env python
#-_-Coding:utf-8-_-
The #enumerate (ITER) function returns a Ganso consisting of index and item values determined by the elements of the ITER iteration object.
def enumerate (name):
For Index, name in enumerate (name):
Print ("%d%s"% (Index, Name))
name = [' John ', ' Jimmy ', ' Tom ', ' Kate ']
Enumerate (name)
Len (SEQ) returns the length of the SEQ
Max (ITER)
Max (ARG0,ARG1, ... key=none)
MIN (ITER)
Min (arg0,arg1, ... key=none)
Reversed (SEQ)
Takes a sequence as a parameter and returns an iterator that is accessed in reverse order.
Sorted (Iter,func=none,key=none,reverse=false)
Takes an iterative object as an argument, returns an ordered list, and the optional parameters Func,key and reverse have the same meaning as the parameters of the List.sort () built-in function.
SUM (seq, int=0)
Returns the sum of the SEQ and optional parameter init, which has the same effect as reduce (operator.add,seq,init)
Zip ([it0, It1, ... ItN])
Returns a list whose first element is It0,it1,... The first element of these elements consists of a tuple, a second ..., and so on.
This article is from "Cool ops" blog, please make sure to keep this source http://19901007.blog.51cto.com/10641668/1688558
Built-in functions (BIFS) that can be used by python---sequence