4/13 is there something obvious im missing?

def fizz_count(x):
    count = 0
    for item in x:
        if item == 'fizz':
            count = count + 1
            return count

questions:i have triple checked my code there are no indentation errors and such but the error keeps saying that fizz_count(['fuzz', 'fuzz', 8, 'buzz', 'fizz', 'fizz']) returned 1 instead of the correct answer: 2


You may be able to check for indentation errors, but how are we to? Please edit your post, select the code portion and press Ctrl+Shift+C. That will preserve your formatting and let us see what you see.


thank you for the formatting advice! now it looks exactly like it is on my editor but it still is not working...


Try backing off the indentation of the return statement. Get it to line up with for

    for ...

    return count


thank you!!!!! it worked!!!
one quoestion though why do i have to line it up with the for not the if?


So that the loop is able to complete all iterations before exiting the function. We don't want the loop to terminate prematurely before the count is accumulated fully.