def fizz_count(x):
count = 0
for item in x:
if x == "fizz":
count = count + 1
return count
enab = ["fizz" , "d" , "bizz"]
said = fizz_count(enab)
print said

what's wrong ?
please help



What do you think could cause this?

Is the error message correct?
Does your function run?
Are you looping through the words?
Are you comparing the right values?
Are you incrementing the count?
Are you returning at the right time?
Are you returning the right value?


yes every thing is fine but i don't know where the mistake


You say that, but it really isn't, is it?

Those questions are all things you can verify and the answers to them say a lot about what the problem is. Those are the things you need to look at to figure out what the mistake is.




i can't find any difference between mine and the one in the post


i knew my mistake


Post? What post?

Here's what's going on:
You have an error message.
It says what is wrong with the behaviour of your function.

What to do:
1) confirm the behaviour by calling it the same way as mentioned, or with another test case
2) if you now agree that your function is incorrect, then consider what you think your function should be doing, and then test if that really it what it is doing. Find out what your code does so that you can tell where it acts differently from what you intend


i mean the example