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 are the key features of Python?

0 Answers  


What is a negative index in python?

1 Answers  


How do you split a list into evenly sized chunks in python?

0 Answers  


What is python with statement?

0 Answers  


Narrate the difference between python arrays and lists.

0 Answers  


What are Python's key features?

2 Answers  


When do you choose a list over a tuple?

0 Answers  


What is the output of this code?

0 Answers  


How to print without newline or space?

0 Answers  


Why Lambda is used in Python?

3 Answers  


How to find whether string is alphanumeric or not?

0 Answers  


Why isn't there a switch or case statement in python?

0 Answers  


Categories