A Day at the Supermarket


#1



Oops, try again. Your code appears to raise an error, see the console window for the error message!

File "python", line 5
if item = 'frizz':
^
SyntaxError: invalid syntax

I not sure how to have the item equal to the string "fizz". I tried if item = 'frizz': but is seem to not be working. Also can you explain why my code is not working. Thanks in advance.


Replace this line with your code. 

def fizz_count(x):
    count = 0
    for item in x:
        if item = 'frizz':
        count= count + 1
    return count


#2

for comparing use two equal signs, a single equal signs means assign, and make sure to spell everything correctly (fizz vs frizz)


#3

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