filmov
tv
Python Dictionaries | Python for Beginners | Quantra Free Course

Показать описание
Timestamp:
00:12 - 01:47 - Dictionary
In the previous few units, we explored the concept of lists. From this unit onwards, we will look at another data structure in python known as ‘Dictionary’.
A dictionary is generally used for mapping. For instance, consider a telephone directory which has names mapped with contact numbers.
You can find the contact number if you have the name of an individual. Similarly, a dictionary in Python also has mapping between “Key” and its “Value”.
You can access the dictionary using ‘keys’ to get the information or ‘value’ stored within these ‘keys’. Hence, unlike lists, dictionaries are indexed by its ‘keys’.
Further unlike lists, which are an ordered sequence of objects, dictionaries are unordered because the items in the dictionaries are accessed via keys and not via their position.
The keys of a dictionary are unique, i.e. no two keys with the same name can store different values. Further, dictionaries are mutable which means that you can change the content of the dictionary without changing their identity. However, the keys of dictionary are immutable.
Dictionary Syntax: Dictionaries are enclosed in brace brackets and the key-value pair should be separated by a comma.
You may pause the video and have a look at some of the examples.
We will look at more such functions that can be performed on dictionaries in the upcoming IPython notebook.
Till then, stay tuned!
Quantra is an online education portal that specializes in Algorithmic and Quantitative trading. Quantra offers various bite-sized, self-paced and interactive courses that are perfect for busy professionals, seeking implementable knowledge in this domain.
Комментарии