Dictionaries
Python Dictionaries
Dictionary is a built-in data type that stores data in key:value pairs. It is mutable and with fast efficient data retrieval.
Dictionary has the following features:
1. Mutable: Dictionaries are mutable, you can change, remove, and update key:pair items.
2. Key:Value pairs: Each key is mapped to a value, keys should be of immutable data type, keys should also be unique.
Creating a dictionary
Dictionaries can be created in several ways such as using a comma-separated key:value pairs, let’s cover each method.
Using a comma-separated key:value pairs
A dictionary can be created using placing comma-separated key:value pair in a curly braces {}