Help on 4/13


#1

my code says this but the error is after the code:

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

but the error says:

File "python", line 3
def count == 0:
^
SyntaxError: invalid syntax


#2

This looks to the interpreter like a function definition, which it is not.

count = 0

#3

so what do i do to fix it?


#4

I just showed you. Remove the def from the variable statement, and change the comparison operator to an assignment.


#5

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