4/13 List indices must be integers, not str



Oops, try again. an exception was raised for fizz_count(['fizz', 'buzz']): list indices must be integers, not str

I expected it to return a value of 1.

def fizz_count(x):
    count = 0
    for word in x:
        if x[word]=="fizz":
    return count


Hey @hciczx,

Python's for loops iterate over the list itself and not indices of the list. So, you do not need to put if x[word] == "fizz", you can simply put if word == "fizz". Hope this clears out your doubts...