Why doesn't this code work?

Is it just me or are there a lot of inconsistencies with this place? I use the following:

#Write your function here
def more_than_n(lst, item, n):
if lst.count(item) > n:
return True
return False

#Uncomment the line below when your function is done
print(more_than_n([2, 4, 6, 2, 3, 2, 1, 2], 2, 3))

get the error:
more_than_n([2, 3, 4], 2, 1) should have returned False , and it returned None

Drop the same code into Pycharm and I get:


This is not hard, and works perfectly fine on my local python install. Not the first issue I’ve had running through these exercises, especially as they start to get a little more complex. But getting very frustrating trying to figure out what the online interpreter is looking for, and finding work-arounds for it to pass. Only about 30% through the first course and this is looking to be a complete waste of money.

Your code should be correct assuming that your indentations are. Therefor I would presume something is wrong with the indentations on the code. In the future you can paste code blocks behind triple ` or use the </> button.