Created 3 years ago
Dictionaries in Python
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
print(thisdict)
{'brand': 'Ford', 'model': 'Mustang', 'year': 1964}
# get the value
thisdict['model']
'Mustang'
thisdict.get('model')
'Mustang'
# change the value
thisdict['year'] = 1965
thisdict['year']
1965