Is my indentation wrong?

I found the solution with my second attempt but can someone explain to me why my first attempt did not work? Cheers

def more_than_n(lst, item, n):
count = lst.count(item)
if count > n:
return True
else:
return False

It works for me. I just had to fix the indentation, which is important in python.

def more_than_n(lst, item, n):
  count = lst.count(item)
  if count > n:
    return True
  else:
    return False