1# creating a list in Python
2mylist= [3,5,1,5,7,8,2,6]
3
4#filter all the odd numbers using lambda
5result = filter(lambda x: x % 2 != 0, mylist)
6print('The odd numbers are ',list(result))
7
8
9#filter all the even numbers using lambda
10result = filter(lambda x: x % 2 == 0, mylist)
11print('The even numbers are ',list(result))