Help on 4/13


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


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

count = 0


so what do i do to fix it?


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


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