4 /14 Lists and Functions- Codeacademy passed my failed task


#1

Codeacademy says my code is OK. Even though I have two "fizz" elements in my array, when I run the code the output window says "None"
Here is my code:

def fizz_count(x):
    count = 0
    for item in x:
        if count < 10:
            if item == "fizz":
                count = count +1
    return count
        
x = ["fizz","dog","fizz"]
fizz_count(x)

#3

Hi @scriptpro91844 ,

Try this ...

print fizz_count(x)