Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Explain the dictionary in Python.



Explain the dictionary in Python...

Answer / 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

More Python Interview Questions

What is python package manager (pypm)?

0 Answers  


How lists is differentiated from tuples?

0 Answers  


Please explain when is the python decorator used?

0 Answers  


Do you need classes in python?

0 Answers  


How will you merge two dictionaries in python?

0 Answers  


What is a closure in python?

0 Answers  


Write a program to convert all strings in list to integers?

0 Answers  


What is a lambda function?

4 Answers  


Is it necessary to know c to learn python?

0 Answers  


What are the two modes of python?

0 Answers  


What is the syntax for dictionary comprehension in python?

0 Answers  


What is static in python?

0 Answers  


Categories