4. Lists + Functions


#1

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

HELP!


#3

Hi, your code should have the following structure
(just add some spaces)


#4

Hi your code is fine its maybe a indent problem so here your code with the right indent

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

#5

that worked, thank you