Help 4.) Lists + Functions


#1
def fizz_count(x):
    count = 0

for item in x:
if item == "fizz":
count = count + 1
return count

This is the code i have (it is indented) and the window reads the following error:
File "python", line 7
SyntaxError: 'return' outside function

PLEASE HELP


#2

make sure the return line is indented 4 spaces in to the function body or you can hit tab once with that cursor at the beginning of the statement
here

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

#3

Thank you. That helped with the problem.


#4

we also have to watch indentation, eh??


#5

Yeah thats what python uses to determine that you are done with a line


#6

alright then, thank you


#8