Hi, I am taking the liberty to get involved, hope that is okay.
My issue with the count-exercise is that it works fine if there is only a single string to be counted.
It fails to check if a list exists in a list though.
def count(sequence, item): count = 0 for i in range(0,len(sequence)): if sequence[i]==item: count+=1 return count
count([1,2,3],1) => This works and returns 1
count([1,2,3],[1,2]) => This fails: It returns 0 but is supposed to return 1
An idea I had was to concatenate all list items from "sequence" into a single string; same for the list items in "item", then apply the count-function. This would only work though if both variables contained a list so I would have to check via the type-function first of all.
My train of thoughts sounds messy and overly complicated though, could need some help here, thanks!