Python Dictionaries
Dictionaries are Exclusive to Python and Very Powerful.
A Python Dictionary is Effectively a Database.
You can think of a Dictionary as an Unorderd List that is accessed by a Key instead of an Index.
Dictionaries have Key:Value pairs inside of Curly Braces, Separated by Commas.
Example:
Keys can be of any Type ... Strings or Integers are best ... avoid Floats.
Each Key must be Unique. If a duplicate Key is entered, the last one Wins.
Only one "Thing" allowed for the Value of each Key.
The Value can be anything ... integer,float,string,tuple,list, or another dict.
Get familiar with Dictionaries... You will need them.
Creating Dictionaries
Here are Some Examples of Creating Dictionaries:
Accessing Dictionaries
A Data Value in a Dictionary is Accessed with it's Key.
Here are Some Examples of Accessing Dictionaries:
Manipulating Dictionaries
Dictionaries are Really Simple to Manipulate.
Here are Some Examples of Changing and Updating Dictionaries: