4. List + Functions


#1



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


Can you help me with this code?


#2

HI these lines

fizz_count(["fizz", "cat", "fizz"])
result = fizz_count(fizz_count)
print result

try it like that

result = fizz_count(["fizz", "cat", "fizz"])
print result

#3

Hey, I've followed all of the instructions and I got this set of code:


It keeps returning 0 as the fizz count.
Would appreciate some help.


#4

never mind I fixed it


#5

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