Created: 2022-07-26
Tags: #fleeting
New Term:
Associate Array
Dictionary in python is basically Associate Array.
A dictionary is basically
GET the value of a particular key
dictionary.get('name_of_key')
REPLACE a value of a particular key
dictionary['name_of_key'] = 'new value to replace old value of key'
ADDING a key-value pair in the dictionary
dict['new_key'] = 'new_value'
How dictionary works
How to read a dictionary code
How to understand a dictionary code

Translating the picture to a code would look like this
MLB_team = {
'Colorado' : 'Rockies',
'Boston' : 'Red Sox',
'Minnesota': 'Twins',
'Milwaukee': 'Brewers',
'Seattle' : 'Mariners'
}
Remember, dictionary uses key: value syntax