Fizz_count help


#1



https://www.codecademy.com/courses/python-beginner-en-IZ9Ra/0/4?curriculum_id=4f89dab3d788890003000096


getting error:
Oops, try again. fizz_count(['fizz', 'fizz', 'fIzZ', 'buzz', 'fizz', 8, 9, 'fizz', 'fIzZ', 8]) returned 1 instead of the correct answer: 4


def fizz_count(x):
    count=0
    for item in x:
        if item=="fizz":
            count=count+1
        return count
fizz_count(['fizz','dog','fiZz','fizz','cat','fizz'])


#3

This needs to be after the loop, not inside it.


#4

awesome.

thank you so much


#8

what do you mean inside the loop? sorry I'm a lil slow lol my code looks the same and I get it wrong it says answer is 1,0,4 its random xD idk please help me
can you show me please if its not to much to ask for thanks.


#9

nvm its after lmao didn't read it correctly thanks anyways


#10

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