list1 = [2,4,6,8,3,4,2,]
From the above list I need to obtain the following result
[2,4,6,8]
Here is the way that how I tried. But it resulted an error without giving the expected result.
list1 = [2,4,6,8,3,4,2,]
x=[]
for num in list1:
if (num % 2 == 0) and (num not in list1):
x.append(num)
print(x)
so I need your help to selecting out even numbers only once without repeating the same number Thanks in Advance...!