Lists + Functions


#1



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


#2

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


#4

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