4/13 What's wrong?


Every time I submit my code it says "Oops, try again. fizz_count(['fizz', 'fizz', 'fuzz']) returned 1 instead of the correct answer: 2"
Heres my code

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

In the editor it is indented correctly I believe unlike my code above


I believe the problem is in this:

count += 1

When it's supposed to be:

count = count + 1


Your code is correct, so the problem is probably the indentation. Try this;

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


this gets the same problem as above.
besides my code is almost identical to yours.