A Day at the Supermarket. List + Funcitons


#1

def fizz_count(x):
count = 0
for item in x:
if item == 'frizz':
count = count + 1
return count
print fizz_count(['fizz', 'story', 'fizz'])

I tried quite a few times to fix this I dont know what the problem is. Please help


#2

What exactly is your problem?
Take a look at this post for some pointers on posting a good question


#3
def fizz_count(x):
    count = 0
    for item in x:
        if item == "fizz":
            count += 1
    return count
    
result = ["fizz", "cat", "fizz"]
another = fizz_count(result)
print another

Try that