Day at eh Super - Lists and Functions - Not getting this one at all


#1

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

        fizz_count(["fizz","cat","fizz"])
        
return count

#2

This line should be outside of the function (below the return, which needs an indent), with no indent. All code inside the function needs to be indented.


#3

a moreover, you fetch items (indexes) from your variable which is x and not fizz_count(), you should correct it to this:

for item in x:

#4

I'm still not getting it:

def fizz_count(fi):

fi = ["fizz", "cat", "dog", "fizz", "Piggyfizz"]

count = 0
return count

for x in fi:
if x == "fizz":
count = count + 1

    print count

#5

Here is my latest update - Still not counting.

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

x = ["fizz", "cat", "dog", "fizz", "Piggyfizz"]
fi = fizz_count(x)

print fi


#6

small correction here:
if item == 'fizz':


#7

That fixed it. Thanks.


#11