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
Why do we use __ init __ in python?
What are the packages?
Tell us what is module and package in python?
What does map function in python do?
Is r similar to python?
What do you understand by monkey patching in python?
In python, how do I read a file line-by-line into a list?
Is python written in python?
Which statement of python is used whenever a statement is required syntactically but the program needs no action?
Tell me how are arguments passed by value or by reference?
What is step size in python?
How to send an email in python language?
How do we make forms in python?
Tell me what is pickling and unpickling?
When do you choose a list over a tuple?