Practice makes perfect
With the code below I get the error message
Oops, try again. Your function fails on count([4, 'foo', 'foo'],5). It returns 1 when it should return 0.
However as I can tell from the included 'print' command it is in fact returning 0 . 0 is printed to the console screen.
def count(sequence,item): counter = 0 while item in sequence: sequence.remove(item) counter = counter + 1 return counter print count([4,'foo','foo'],5)