Answer Posted / chaitanya
Python's built-in data type is dictionary, which defines one-to-one relationships between keys and values.
Dictionaries consist of pairs of keys and their corresponding values.
Dictionaries are indexed by keys.
Dictionary is similar to associative array or hash table of other languages.
As following example explains further- India, Angel & Cartoon are keys & their corresponding values are Bharat, Mother Teresa & Mickey respectively.
>>> dict = {'India': 'Bharat', 'Angel': ‘Mother Teresa’, 'Cartoon': 'Mickey'}
>>>print dict[India]
Bharat
>>>print dict[Angel]
Mother Teresa
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Which software is used for python?
What do you mean by list comprehension?
Explain python’s pass by references vs pass by value.
Is multiple inheritances possible in python?
What do (lambda) function closures capture in python?
What is a class definition in python?
What is flask in python?
Explain inheritance in python with example?
Differentiate between .py and .pyc files?
What is whitespace in python?
What is the process of pickling and unpicling?
Can we use else with for loop in python?
What is the difference between args and kwargs?
What are the 3 types of numbers in python?
What is the directory in python?