I'm stuck on count.
My code looks similar to other solutions on the forums but it returns the error below and i can't figure out why:
"Oops, try again. Your function fails on count([4, 'foo', 5, 'foo'],5). It returns 0 when it should return 1."
def count(sequence, item): found = 0 #initalise found at 0 for i in sequence: #loop through sequence if i == item: #if i is the same as item found += 1 #increment found by one return found
Any suggestions greatly appreciated!