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
What are the disadvantages of Python Recursion?
What do you understand by the process of compilation and linking in python?
Print the length of each line in the file ‘file.txt’ not including any whitespaces at the end of the lines?
What do you mean by list comprehension in python?
What is a raw input in python?
Explain split() methods of "re" module in python?
Will the do-while loop work if you don’t end it with a semicolon?
What does time sleep do in python?
What is a module in python?
what is beautifulsoup module will do in python?
Does python have overloading?
Why are tuples immutable?
In python, how do I read a file line-by-line into a list?
How to convert a list into a string?
Explain about raising error exceptions?