filter a user-defined function : Filter : Buildin Function PYTHON TUTORIALS


PYTHON TUTORIALS » Buildin Function » Filter »

 

filter a user-defined function


from random import randint

def odd(n):
    return n % 2

allNums = []
for eachNum in range(9):
    allNums.append(randint(199))

print filter(odd, allNums)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Buildin Function
» Filter