Purify help


#1

why is this not working?



def purify(numbers):
  new_list = []
  for x in numbers:
    if x %2 == 0:
      new_list.append(x)
      return new_list



#2

Move the return statement to the left so it is outside of the loop.


#3

thanks that worked :slight_smile:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.