#4 lists and functions


Hello, my code keeps returning "0" for the count instead of the correct number "1". Could someone please explain where my code is incorrect.
Thank you

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



count == count + 1

this line, will check if count equals count + 1, why? i would update/re-assign count variable here.

Also, to print what the function returns, add the print statement before the function call


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