Next Index Previous

Python Examples

24. filter() function example.

nums = [3,6,4,2,9,8]

def check_even(n):
	if n%2==0:
		return n

res = list(filter(check_even, nums))
print(res)
Output :
[6,4,2,8]



Father of Python Language

Guido-van-Rossum

Guido van Rossum

Born: January 31, 1956, Netherlands