Help me; Whats wrong with my code? def fizz_count(x): count = 0 for item in x: if item == 'fizz': count += count return count
that means count = count + count?
Yes, it is equivalent to ...
count = count + count
count starts out at
0, what happens the first time the statement is executed?
Not sure how to get the indents to work correctly in the post.
But, the code wasn't finished.
def fizz_count(x): count = 0 for item in x: if item == "fizz": count = count + 1 return count lost = ['fizz','buzz', 'fizz'] this = fizz_count(lost) print this
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.