4. List + Functions (Help!)


#1



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


ERROR MESSAGE: Oops, try again. fizz_count(['fizz', 'buzz']) returned 0 instead of the correct answer: 1


Hello, please help me, am going crazy with this. The code should work correctly, I've been through the other Q&A and most got it wrong in the indentation but I've checked this repeatedly. Am not sure what am doing wrong, tried adding an example but is also wrong, the function somwhow is not working


def fizz_count(x):
    count = 0
    for item in x:
        if x == 'fizz':
            count = count + 1
    return count


#2

Did you mean, if item == 'fizz'?


#3

Yes!!! Couldn't see it jaja. Many thanks!


#5