Top "Dictionary" questions

A dictionary maps keys to values allowing efficient retrieval of values by keys.

append multiple values for one key in a dictionary

I am new to python and I have a list of years and values for each year. What I want …

python dictionary key-value
How to find if a given key exists in a C++ std::map

I'm trying to check if a given key is in a map and somewhat can't do it: typedef map<…

c++ dictionary stl
How to sort Map values by key in Java?

I have a Map that has strings for both keys and values. Data is like following: "question1", "1" "question9", "1" "question2", "4" "question5", "2" …

java dictionary hashmap
How to update the value stored in Dictionary in C#?

How to update value for a specific key in a dictionary Dictionary<string, int>?

c# dictionary
Python: Checking if a 'Dictionary' is empty doesn't seem to work

I am trying to check if a dictionary is empty but it doesn't behave properly. It just skips it and …

python dictionary
Why dict.get(key) instead of dict[key]?

Today, I came across the dict method get which, given a key in the dictionary, returns the associated value. For …

python dictionary
get dictionary key by value

How do I get a Dictionary key by value in C#? Dictionary<string, string> types = new Dictionary<…

c# dictionary
How do you create a dictionary in Java?

I am trying to implement a dictionary (as in the physical book). I have a list of words and their …

java dictionary key-value
Converting dictionary to JSON

r = {'is_claimed': 'True', 'rating': 3.5} r = json.dumps(r) file.write(str(r['rating'])) I am not able to access …

python json python-2.7 dictionary
Append a dictionary to a dictionary

I have two existing dictionaries, and I wish to 'append' one of them to the other. By that I mean …

python dictionary