Hello everyone, I am stuck on exercise 12. purify. The error message displayed reads:
Oops, try again. Your function fails on purify([4, 5, 5, 4]). It returns [4, 5, 4] when it should return [4, 4].
I'm not very good at coding and I often have to use the help forums. Any advice on how to change my code to make it work would be much appreciated.
Replace this line with your code. def purify(listnum): for num in listnum: if num % 2 != 0: listnum.remove(num) return listnum