len(pairs[])
raises a SyntaxError
because the square brackets are empty:
>>> pairs = [('cheese', 'queso'), ('red', 'rojo'), ('school', 'escuela')]
>>> pairs[]
File "<stdin>", line 1
pairs[]
^
SyntaxError: invalid syntax
>>>
You need to tell Python where to index the list pairs
:
>>> pairs = [('cheese', 'queso'), ('red', 'rojo'), ('school', 'escuela')]
>>> pairs[0] # Remember that Python indexing starts at 0
('cheese', 'queso')
>>> pairs[1]
('red', 'rojo')
>>> pairs[2]
('school', 'escuela')
>>> len(pairs[0]) # Length of tuple at index 0
2
>>> len(pairs[1]) # Length of tuple at index 1
2
>>> len(pairs[2]) # Length of tuple at index 2
2
>>>
I think it would be beneficial for you to read An Introduction to Python Lists and Explain Python's slice notation.