4. Python A Day at the Supermarket: Lists + Functions


A Day at the Supermarket 4.Lists + Funtions

File "python", line 8
fizz_count = (['fizz", "cat", "fizz"])
SyntaxError: EOL while scanning string literal

Replace this line with your code. 
def fizz_count(x):
    count = 0
    for item in x:
        if item == 'fizz':
            count == count + 1
            return count
            fizz_count = (['fizz", "cat", "fizz"])

I am just LOST as to what the hell it wants and the purpose. Could someone explain this exercise better? The lesson is HORRIBLY written. It's like 5 lessons in one.


You has problems with tabs.
Your fizz_count should be on par with the def, and your return must be on par with the if


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