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

Do they know a tuple/list/dict when they see it?

0 Answers  


What is a numpy array?

0 Answers  


Which python function will you use to convert a number to a string?

0 Answers  


Does python support database programming?

0 Answers  


What is the most "pythonic" way to iterate over a list in chunks?

0 Answers  


What is set when we have to use?

0 Answers  


What is an interpreter for python?

0 Answers  


How to remove whitespaces from a string in python?

0 Answers  


Does python support interfaces like java does?

0 Answers  


What are accessors, mutators, @property?

0 Answers  


What is print in python?

0 Answers  


What is the use of negative indexes?

0 Answers  


Categories