4. Listas + Funciones

Oops! Try again. Your function does not work with ['fizz', 0, 0] as input data

def fizzCount(cadena):
    count = 0
    for x in cadena:
        count = count +1
    return count
print fizzCount("fizz")


can you provide the exercise url?

your code seems to count all elements in list, it should only count fizz


The instructions say that the name of the function must be fizz_count, and count = count + 1 should only happen if x == "fizz".


thanks for the reply


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