4/13 What's wrong?


#1

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


#2

I believe the problem is in this:

count += 1

When it's supposed to be:

count = count + 1

#3

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

#5

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