Fizz count


Why doesn’t this code return a number of fizzes?

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


your code work !!
you just should print the result( total number of fizz) by
print fizz_count(["fizz", 'fizz', 'cat', 'fizz'])


It does, if you want to print them to console you need to put print before calling function