COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
list
|
|
string
|
|
dictionart
|
|
dictionary
|
Detailed explanation-1: -A dictionary is an unordered data structure with elements separated by a comma and stored as a key-value pair.
Detailed explanation-2: -Represents an unordered collection of keys and values. The Dictionary data type is optimized for fast lookup of values. The following methods are available on instances of the Dictionary data type.
Detailed explanation-3: -Python’s dictionaries are kind of hash table type. They work like associative arrays or hashes found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type, but are usually numbers or strings.
Detailed explanation-4: -For example, you can use an integer, float, string, or Boolean as a dictionary key. However, neither a list nor another dictionary can serve as a dictionary key, because lists and dictionaries are mutable. Values, on the other hand, can be any type and can be used more than once.