COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
Records are most similar to which other function in Python?
|
Dictionaries
|
|
List
|
|
Array
|
|
None of the other options
|
Explanation:
Detailed explanation-1: -The dict() function creates a dictionary.
Detailed explanation-2: -The compare method cmp() is used in Python to compare values and keys of two dictionaries. If method returns 0 if both dictionaries are equal, 1 if dic1 > dict2 and-1 if dict1 < dict2.
Detailed explanation-3: -Similarity: Both List and Dictionary are mutable datatypes. Dissimilarity: List is a sequential data type i.e. they are indexed. Dictionary is a mapping datatype.
Detailed explanation-4: -Dictionaries are Python’s implementation of a data structure that is more generally known as an associative array.
There is 1 question to complete.