Python Python Basics (2015) Shopping List App Continue

Steven Gutierrez
Steven Gutierrez
Full Stack JavaScript Techdegree Student 9,035 Points

Index Issue

I think my issue is how index 0 is written. Am I right?

breaks.py
def loopy(items):
    for item in (items):
        if item(0) == "a"
        contine

        print(item)

1 Answer

Jeffrey James
Jeffrey James
2,635 Points

yeah indexing uses square brackets

>>> data = [1,2,3]
>>> data[0]
1
>>> data(0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'list' object is not callable
>>> 
Steven Gutierrez
Steven Gutierrez
Full Stack JavaScript Techdegree Student 9,035 Points

Wow how did I miss that. I also spelled "continue", but it's still not giving it to me. What am I don't wrong?