Replace this line with your code. def fizz_count(x): count=0 for item in x: if item =="fizz": count=count+1 x=["fizz","buzz"] count=fizz_count(x) print count # Write your function below!
your indention is not so good. The function call is inside the function (change the indention so it is outside the function), the list which you pass into the function as argument should also be defined outside the function
Do you have the exercise url?
Also, depending on the exercise you need to return the count, but i don't see a return keyword anywhere
here you gohttps://www.codecademy.com/courses/python-beginner-en-IZ9Ra/0/4?curriculum_id=4f89dab3d788890003000096
Did you make any changes i suggested? If so, can i see an updated version of your code?
the only reason i wanted the url, was so i could find the exercise, it will just load my own code, you will have to post an updated version of your code
more people who use windows xp.
Anyway, sorry, got distracted. Uhm.. your function call and so on is still inside your function (should be no indent) and there is still no
return count (also think careful how that one should indented)
If more help is required, post an updated version of your code, and if you want to save yourself some time learn how to make indent show on the forum:
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.