Purify does not recognize numbers


#1

Hello, My purify code is like this

 def purify(num):
     p_num = []
     for i in [num]:
         if i % 2 == 0:
             p_num.append(i)
     return p_num
 print purify([1,2,3])

All is well untell I run it and get this error
that says an int and list can not go together in this line
if i % 2 == 0:
Help would be appreciated if you know how to get my code to recognize numbers.


#2

It's not a number. It's a list. You might want to iterate through num instead of assigning num to i


#3

Thank you for your help