Oops, try again. Your function fails on count([4, 'foo', 'foo'],5). It returns 1 when it should return 0.
I am working with python 3, but even if I run it on python 2 in other platforms it returns 0. Just in this place would return 1.
I would really appreciate your comments
Replace this line with your code. def count(sequence, item): c=0 while item in sequence: c+=1 sequence.remove(item) return c