This post explains what is dictionary in Python. The dictionary in Python is the data object, that is indexed with keys, which can be both numbers and strings. Dictionary is presented as a key-value pair.
Dictionary usually represented the following way: .
Main operations that can be performed with the dictionaries are:
- storing pair
- deleting pair
- logical identification with the keyword
- and others
Interesting method that is applied to dictionaries is that returns key and a value of the dictionary object.
We can convert elements of the file into dictionary and apply different statement in order to work with dictionary objects, like or . We can also use loops to work with dictionary objects.
You can also do text parsing using dictionaries.
Examples of all mentioned above actions with dictionaries you can find in our Github library.