Compute prime numbers in Python : filter « Buildin Function « Python






Compute prime numbers in Python

Compute prime numbers in Python


nums = range(2, 50) 
for i in range(2, 8): 
     nums = filter(lambda x: x == i or x % i, nums)
 
print nums



           
       








Related examples in the same category

1.Filter demo: lambda function insideFilter demo: lambda function inside
2.Functional Programming Tools: filterFunctional Programming Tools: filter
3.filer with lambda function and rangefiler with lambda function and range