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
How to generate all permutations of a list in python?
Explain about multi-threading concept in python?
What is file context manager?
What is the length of your largest python code? Can you please describe the project?
What is abc abstractmethod?
What does r in a circle mean?
How do you create a database in python?
What are advantages of a tuple over a list?
Is anaconda the same as python?
How is python different from java?
How will you uit the python?
What is the cost of python certification?
Is python too slow?
What is docstring in Python?
What do you mean by ‘suites’ in python?