Keeps on comparing to a different list items!


#1



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


I'm getting the count right but it keeps comparing to another list.

Oops, try again. fizz_count(['fizz', 'buzz']) returned 3 instead of the correct answer: 1

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

x = ["fizz","fizz","frizz","fizz","fuzz"]

count1 = fizz_count(x)
print count1


Replace this line with your code.


#2

Found the fix!

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

x = ["fizz","fizz","frizz","fizz","fuzz"]

count1 = fizz_count(x)
print count1