List + Functions.4 I don´t know where is my mistake, help


#1

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

x=["fizz","fizz","fizz","fizz","fizz","fizz","fizz","fizz","fizz","fizz","fizz","cola","sucia","bebe"]

fizz=fizz_count(x)

print fizz


#2

it says that my count is 0


#3

For this exercise, you only need to type:

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

and beware of any indentations made.


#4

The problem with yours is that, in the for loop you named a variable "name". But you used the variable "x" in your if statement. I made the same mistake.