Fizz_count(['fizz', 'buzz']) returned 0 instead of the correct answer: 1


#1

I've been stuck on this exercise for quite a while and I have no clue what I'm doing wrong. Please Help!

Write your function below!

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


#2

if x == "fizz":

Your iteration variable is word ?


#3

I just saw it with word as variable on another topic so I tried it but it didn't work with variable x neither


#4

Can you format your code?
select your code and use </>

...or read this Article


#7

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