When running my code for the lesson I get this error message:
"Your function fails on count([4, 'foo', 5, 'foo'],5). It returns 0 when it should return 1."
I'm not sure why this happens. it shouldn't fail because I am converting it to a string so it should be able to accept numbers and words.
def count(sequence, item): item = str(item) found = 0 for i in sequence: #loop through sequence if str(i) == item: #if i is the same as item found += 1 #increase found by one return found