filter(function, iterable): Construct a list from those elements of iterable for which function returns true. 对iterable中的item依次执行function(item),将执行结果为True的item组成一个List/String/Tuple(取决于iterable的类型)返回. iterable包括列表,iterator等.一个简单例子,过滤出一个整数列表中所有的奇数 >>&…
filter built-in function filter(f,sequence) filter can apply the function f to each element of sequence. If return is true the element will be returned and re-organized to be a new sequence. The type of new sequence can be list/tuple/string, this dep…