Mistake


#1

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


#2


#3

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?


#4

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


#5

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.


#6

https://www.codecademy.com/en/courses/python-beginner-en-IZ9Ra/0/4?curriculum_id=4f89dab3d788890003000096


#7

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


#8

i knew my mistake
thanx


#9

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


#10

understood
i mean the example