Fizz Count Help!


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

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

Thanks to anyone who helps!


You are trying to assign count to count += 1, but you are using a double equal sign so you're actually comparing. Get rid of an equal sign.


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