4. Lists + Functions



Write your function below!

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

x = ["fizz","cat","fizz"]

fizz = fizz_count(x)
print fizzl



Codecademy says its correct but i dont like the result..

Does somebody know why i get this?


You'd need to argue for why it would behave differently (and the code would need to be completely intact for anyone to read or run it)



I got it, i made a typo, instead of print fizz, i made first fizzl


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.