A Day at the Supermarket


#1

Write your function below!

def fizz_count(x)
count = 0
for x in fizz_count:
if x == "fizz":
count += 1
return count

What am I doing wrong? This is what it says when I submit it. I've been stuck on this for a while and I have a deadline to meet

File "python", line 2
def fizz_count(x)
^
SyntaxError: invalid syntax


#2

Missing a colon to start the block.

def fizz_count(x):

Interpreting syntax errors is a skill in itself, and one worth developing.

File "python", line 2
    def fizz_count(x)
                     ^
SyntaxError: invalid syntax

This pretty much points it right out.


#3

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