Lists + Functions


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

My code matches the master exactly and still receiving same error.

# Write your function below!
def fizz_count(x):
    count = 0
    for item in x:
        if x == "fizz":
            count = count+1
    return count


nevermind. I figured it out. i was using x in my "if" statement instead of item...


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