Dictionary
Rakesh Nayak, Nishu Gupta · 2022
In Python, a dictionary is a collection of unordered data that may be retrieved by key rather than index. The keys have to be hashable (unique) such as integers, floating point numbers, strings, tuples and frozenset. The keys in the dictionary must be of an immutable type. The dictionary stores pairs of values, one of which is the key and the other is the key–value pair element. A dictionary can be created by placing a sequence of elements within curly { } brackets, separated by a “comma”. In this chapter, we’ll learn how to create, access and execute various operations on a dictionary.