The built-in datatypes in Python is called dictionary. It defines one-to-one relationship between keys and values. Dictionaries contain pair of keys and their corresponding values. Dictionaries are indexed by keys.A dictionary key have numbers and strings in python like Values.
Example:
dict={'Country':'India','Capital':'Delhi','PM':'Modi'} print dict[Country]
India
print dict[Capital]
Delhi
print dict[PM]
Modi
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Dictionary in Python :
The built-in datatypes in Python is called dictionary. It defines one-to-one relationship between keys and values. Dictionaries contain pair of keys and their corresponding values. Dictionaries are indexed by keys.A dictionary key have numbers and strings in python like Values.
Example:
dict={'Country':'India','Capital':'Delhi','PM':'Modi'}print dict[Country]
India
print dict[Capital]
Delhi
print dict[PM]
Modi