Use filter() and lambda to obtain the set of odd numbers from a sequence : Filter : Buildin Function PYTHON TUTORIALS


PYTHON TUTORIALS » Buildin Function » Filter »

 

Use filter() and lambda to obtain the set of odd numbers from a sequence


seq = [23971812111211109910109]
print filter(lambda x: x % 2, seq)
print [for x in seq if x % 2]



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo Buildin Function
» Filter