Lists+functions


#1

i can't run it well,
plz give my a hand~

Write your function below!

def fizz_count(x):
count==0
for n in x :
if n =="fizz":
count=count+1
return count
print fizz_count(["fizz","cat","fizz","buzz"])

and it show=>
Oops, try again. Your code appears to raise an error, see the console window for the error message!


#2

Hi, @methodwhiz94040 ,

You should format code when you post it so that we can see its indentation and other important details. See How do I format code in my posts?.

Codecademy responded to your code submission with the following message ...

Oops, try again. Your code appears to raise an error, see the console window for the error message!

What was the message in the console window? It is important to look at that window whenever you submit code, because that is where output and error messages are displayed.


#3

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