Oops, try again. Your code looks a bit off--it threw a "invalid literal for int() with base 10: 'one'" error. Check the Hint if you need help!

Well on the console, it does print out the answer expected, but I am still getting an error.

Replace this line with your code. 

def count(sequence,item): 
    count_list = [] 
    item = int(item)
    for i in sequence:
        if i == item:
    return len(count_list)
print count([1, 2, 1, 1] , 1)


Is this line even needed? All that really matters is that the sequence contains items of the same type as item. This program should work with any primitives, int, float, boolean, or string.


man thanks for the help! what a silly mistake that was!
I'll be more careful in debugging next time. This was my first question and
it's good to know that there's help available when needed :wink: