Functional Programming Tools: filter : Functional Programming : Function : Python examples (example source code) Organized by topic

C++
PHP
Python
Python Home »  Function   » [  Functional Programming  ]  Screenshots 
 



Functional Programming Tools: filter



"filter(function, sequence)" returns a sequence consisting of those items from 
# the sequence for which function(itemis trueIf sequence is a string or tuple, 
# the result will be of the same type; otherwise, it is always a list. 
# For example, to compute some primes:

def f(x)return x % != and x % != 0

print filter(f, range(225))

           
       
Related examples in the same category
1.  Functional Programming Tools: map Functional Programming Tools: map
2.  Functional Programming Tools: map: More than one sequence may be passed Functional Programming Tools: map: More than one sequence may be passed
3.  Functional Programming Tools: reduce Functional Programming Tools: reduce
4.  Functional Programming Tools: reduce 2 Functional Programming Tools: reduce 2
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.