A day at the supermarket


Write your function below!

def fizz_count(x):
count = 0
for item in x:
if item >= "fizz":
count = count + 1
return count
Oops, try again. fizz_count(['fizz', 'fuzz', 'fizz', 'buzz', 'fIzZ', 'fizz']) returned 4 instead of the correct answer:


could you explain why you choice this:

if item >= "fizz":

for your if condition?


in the step it said make item equal to "fizz"


but >= doesn't mean equal, >= means greater or equal to.


or did I miss something because I cant figure it out


but when I put the = it said that its wrong


a single equal sign means assign, not check if is equal.

check the MDN doc on comparison operators:


oh yeah I forgot about that sorry


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