11. Count


#1



I need some little help with this code:


def count(sequence, item):
    sequence = []
    result = 0
    for w in sequence:
        if w == item:
            result += 1
            
    return result


The error i get is
"Oops, try again. Your function fails on count([4, 'foo', 5, 'foo'],5). It returns 0 when it should return 1."
I really don't understand what am i doing wrong.
Thanks.


#2

here:

sequence = []

you overwrite the function parameter, you shouldn't


#3

that was so easy, i don't know how i missed it.
Thank you so much


#4