Lists + Functions


#1



it says that it returns false not 1


what is wrong


Replace this line with your code. 

# Write your function below!
def fizz_count(x):
    count = 0
    for item in x:
        if item == 'fizz':
            return count = count + 1
            return count

https://www.codecademy.com/courses/python-beginner-en-IZ9Ra/0/4?curriculum_id=4f89dab3d788890003000096


#2

Function ends on the keyword, return.
Remove the first return and unindent the second return line so that it lines up with the for loop.


#3

2 posts were split to a new topic: Why this isn't a valid reassignment


#4

Oh that's a good point haha. I didn't even notice that, thank you.


#5

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