Am getting this error, Oops, try again. Your function fails on count([1],7). It returns [] when it should return 0. am not able to find out where my mistakes are. help plz

def count(sequence, item):
    found = []
    for i in  found:
        if i == item:
            found = found
    return found

#Thanks for your help and guide



found = []

why is found a list? You want to count the number of items in sequence. For counting, use numbers (integers)


i have set found as a variable by making it equal to zero, but now it is giving me another error

Oops, try again. Does your count function take exactly two arguments: a list and an item to check against that list? Your code threw a "'int' object is not iterable" error.


okay, good first step. Then why do you loop over found? sequence contains the list of which you want to count


it just worked out with that correction, thank you so much...let me now figure it out for better understanding