I get an error message saying that it takes too long for my code to return a result and to check for an infinite loop. When I run this outside of the codecademy site it works fine. What am I doing wrong?
Should return a count of the specified integer (item) found within a given list (sequence).
def count(sequence,item): i = 0 found = 0 while i <= len(sequence): if item in sequence: found += 1 i += 1 sequence.remove(item) return found