How to initialize Dictionary using collection initialize?



How to initialize Dictionary using collection initialize?..

Answer / Upasna Sharma

In many programming languages like C# and Python, you can use dictionary comprehensions or the built-in functions to initialize a dictionary. For example, in Python: `dictionary = dict.fromkeys(collection, default_value)`.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

Define disjoint set adt?

1 Answers  


What is the difference between 1d and 2d array?

1 Answers  


What are data members?

1 Answers  


What exactly is data?

1 Answers  


Where will be the free node available while inserting a new node in a linked list?

1 Answers  


What is the prerequisite for binary searching?

1 Answers   Expedia,


What is structured data with example?

1 Answers  


What is worst case complexity algorithm?

1 Answers  


What is the similarity between a Structure, Union and enumeration?

1 Answers  


Which sorting technique is faster?

1 Answers  


What is queue example?

1 Answers  


Is hashmap an object?

1 Answers  


Categories