11.count


#1

def count(sequence,item):
    the_count = 0
    for that in sequence:
        if that == item:
                the_count += 1
    return the_count

That was my code and it works. However, I am confused on WHY it does. I understand the code, but the instructions said:
"The item you input may be an integer, string, float, or even another list!"

Doesn't this mean that you should use int() around item? Well when I did that, I got this error:
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!

Not sure what the error means, and google isn't helping much.

Replace this line with your code.


#2

This statement is unfortunately not true, if sequence is a list with integers and item is a integer it will work. But if item is a list, it won't work.

It is of course a great if you could write a program which does match with what the instructions say