4. Lists + Functions


#1

Code:

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

Result:


None

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

Does somebody know why i get this?


#2

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)


#3

thanks!

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


#4

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