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
Is python object-oriented? What is object-oriented programming?
What is yield in python?
Is python shell scripting?
How will you convert an integer to a hexadecimal string in python?
Is python completely free?
Why is python good for beginners?
What does super () mean in python?
Can you sort a set in python?
Does python has private keyword in python ? How to make any variable private in python ?
Write a command to convert a string into an int in python.
Why is __ init __ used in python?
What does serialization mean in python?
Does python support multiple inheritance?
What is a program interpreter?
What sort does python use?