Learn practical skills, build real-world projects, and advance your career

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