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