I do not understand what is wrong


#1



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

fizz_count(["fizz", "cat", "fizz"])


#2

Try: count = 0 +1.
That should work.


#3

I got, it was actually the return count not indented properly.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.