4. Lists + Functions


#1

What this wrong with this code?

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

The error code: Oops, try again. fizz_count(['fIzZ', 5, 'fizz', 'fizz', 'buzz', 'fizz', 2, 'buzz', 'fizz', 1]) returned 1 instead of the correct answer: 4

Please help!


#2

Neeeeeevermind, I got it... The problem was indention.