Lists + Functions


Oops, try again. fizz_count(['fizz', 'buzz']) returned 0 instead of the correct answer: 1

Why won't it add "fizz"

Replace this line with your code. 
def fizz_count(x):
    count = 0
    for item in x:
        if x == "fizz":
            count = count + 1
        return count


x is the list, item is the 'fizz' (or not).


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