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


step 4 of the instructions:

After the loop, please return the count variable.

i don't see a return keyword anywhere.


i put return and nothing changed error it gives is Oops, try again. fizz_count(['fizz', 'fizz', 'fizz', 'fuzz', 'fizz']) returned 1 instead of the correct answer: 4


a function ends the moment a return keyword is reached (given it hands you something back), so the return should be after the loop (as mentioned in the instructions)(hint: indention)


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