4. list and functions


I have no idea whats going wrong here

i get the result: fizz_count(['fizz', 'buzz']) returned 0 instead of the correct answer: 1

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

please help me out


item will hold (in turn) the items in the list, so you should compare fizz with item not with x (the whole list)


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