Python has something called the dictionary. Explain using an example



Python has something called the dictionary. Explain using an example..

Answer / Sharib Ahmad

A dictionary in Python is a collection of key-value pairs, where keys are unique and hashable objects, and values can be any type. Dictionaries in Python are created using curly braces `{}`.nExample:n```pythonndict = {n 'name': 'John',n 'age': 30,n 'city': 'New York'n}nprint(dict['name'])n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How do you find the type and identification number of an object in python?

1 Answers  


What is __ main __ in python?

1 Answers  


Explain docstring in python?

1 Answers  


How do you exit a python script?

1 Answers  


What is the difference between interpreted and compiled languages?

1 Answers  


How do you clean pyc files?

1 Answers  


How do you write code in python?

1 Answers  


What is the key difference between a list and the tuple?

1 Answers  


How do you protect python source code?

1 Answers  


Are uuids sequential?

1 Answers  


How do you create a list which is a reverse version on another list in python?

1 Answers  


What is argument in a function?

1 Answers  


Categories