Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how do we use a dictionary

+13 votes
asked Jul 11 by Tobenna nwachukwu (220 points)

2 Answers

0 votes
answered Jul 12 by Peter Minarik (55,660 points)

In a dictionary, you store key-value pairs. The key must be unique. Typically hashing is used to find elements quickly based on the keys.

All dictionaries work quite the same. You can check out Microsoft Documentation on C# Dictionary for details and examples here.

+1 vote
answered Jul 13 by Modugula Vyshnavi (160 points)

In Python, a dictionary can be created by placing a sequence of elements within curly {} braces, separated by ‘comma’. Dictionary holds pairs of values, one being the Key and the other corresponding pair element being its Key:value. Values in a dictionary can be of any data type and can be duplicated, whereas keys can’t be repeated and must be immutable

Note – Dictionary keys are case sensitive, the same name but different cases of Key will be treated distinctly. 

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.