Help on the Link + Functions


Hi everyone, I am a little confused at what I am doing wrong here. I am getting the answer 0 instead of 1 and I am not really sure how.

I am new to this and would appreciate any help at all.

Thank you again,

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



count == count + 1

to update/re-assign a variable, you use a single equal sign. Two equal signs means compare


count = count + 1
u wrote count == count + 1


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