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()
When you used { for i in x } then here 'i' is the item of the list and not an index. Hence,
Corrected Code is:
def fizz_count(x): count = 0 for i in x: if i == 'fizz': count = count + 1 return count print fizz_count(['fizz', 'buzz'])
OUTPUT
1