I\'m working on a Python exercise at Codecademy and got stuck on what looks like a simple problem:
Write a function fizz_count() that loops t
fizz_count()
You are passing in a list ['fizz', 'buzz']) so i is equal to fizz or buzz not an integer. Try if i =="fizz"
['fizz', 'buzz'])
i
fizz
buzz
if i =="fizz"
def fizz_count(x): count = 0 for i in x: if i == 'fizz': # i will be each element in your list count = count + 1 return count