11/15 Count (practice makes perfect)


def count(sequence,item):
lst = []
for x in sequence:
if x == item:
return len(lst.append(x))

what is wrong in my code? i have done proper indentation though it is not visible here.


Here is some code for to look at, as it says in the instructions you want the count of how many times an item appears in a sequence.

def count(sequence, item):
    zcount = 0
    for i in sequence:
        if i == item:
            zcount += 1

    return zcount