What is a dictionary in python?



What is a dictionary in python?..

Answer / Mukesh Kumar Singh

A dictionary in Python is a collection of key-value pairs, where keys are unique and immutable objects (like strings or integers) and values can be any object. Dictionaries are defined using curly braces `{}` and are indexed by their keys rather than their position like lists. Keys must be unique within the dictionary, but values do not have to be.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

Where is freeze for windows?

1 Answers  


Mention the concept used in python for memory managing

1 Answers  


What a blank curly brace initialize? A dictionary or a set?

1 Answers  


Difference between __str__ and __repr__ in python?

1 Answers  


What are literals in python?

1 Answers  


Is python faster than python2?

1 Answers  


How do you upgrade pip?

1 Answers  


What language is python written in?

1 Answers  


Explain a few methods to implement functionally oriented programming in python?

1 Answers  


What is after quad?

1 Answers  


How do I sort a list in python 3?

1 Answers  


What is range() in python? Give an example to explain it.

1 Answers  


Categories