# 4 Lists and functions trouble


#1


4 Lists and functions

I am not sure what I did, could someone please help?


Oops, try again. The function fizz_count seems to be missing!


https://www.codecademy.com/courses/python-beginner-en-IZ9Ra/0/4?curriculum_id=4f89dab3d788890003000096
Replace this line with your code. 
def count_fizz(x):
    total = 0
    for item in x:
        if item == 'fizz':
            total + 1
            return total
            print total


#2

I believe you're supposed to name your function fizz_count and not count_fizz.


#3

i believe that in line 5, you're supposed to set total equal to total plust one, so it'll look like total = total + 1. and in line 7, you don't need the print total because you're already returning total in line 6


#4

I made the changes and now my error message
Oops, try again. fizz_count(['buzz', 'fIzZ', 'buzz', 4]) returned None instead of the correct answer: 0


#5

I made change and it still is having trouble.
Could you please look at it again?
thank you

Oops, try again. fizz_count(['buzz', 'fIzZ', 'buzz', 4]) returned None instead of the correct answer: 0


#6

Change your total + 1 to total +=1 or total = total +1as youre not storing anything to total currently. Also line your return statement with the for loop like this:

for foo in foofoo:
    if foo == 5:
        foo = foo +1
return foo

#7

thank you for your help


#8

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