Skip to main content

Filter Function in Python

 



# This code with print greater then n(5) numbers are available in list

l = [1,2,3,4,5,6,7,8]
def greater(n):
    return n>5


g = list(filter(greater,l))
print(g)



Comments