Oops, try again. fizz_count(['fizz', 'buzz']) returned 3 instead of the correct answer: 1
I dont get a few things. First: I didnt give the input 'fizz','buzz' so why does it give an error on that?
It changes to different errors for different lists, even if I dont change anything in the code. So it seems to be running through lists which are in the program to check whether the code works.
But in the console it returns it correctly. I tried with many different lists and it always works fine, even with numbers in them.
So what exactly is wrong here?
Thanks for your help
update: tried to refresh browser, to no avail
# Write your function below! def fizz_count(list): count = 0 for item in x: if item == 'fizz': count += 1 return count x = ['fizz', 'fuzz', 'fizz', 'fizz'] counter = fizz_count(x) print counter # ['fizz', 3, 1, 6, 'fizz'] returned 1 instead of the correct answer 2 #(this is also not true, it returned 2 in the console)