dictionaries#
What is a dictionary? Information organized into key:value pairs.
filipa = {
'name': ['filipa', 'da gama', 'calado'],
'age': 35,
'degree': 'literature',
'jobs': ['professor', 'digital scholarship specialist', 'student']
}
How do we access items within a column? With brackets.
filipa['jobs']
['professor', 'digital scholarship specialist', 'student']
filipa['age']
35
How do we access items within a column? With list indexing.
filipa['name'][0]
'filipa'
Don’t worry if this looks wonky to you now. We will have plenty of time to practice in the next few lessons on APIs.