Skip to content
Advertisement

Is there a way to find a value in a dictionary if the key has multiple values?

So for example:

JavaScript

How would I look for valuee in the dictionary a? I have looked at other articles but most are unhelpful so I thought to turn to this website. Are there any other details I need to add to this post?

Advertisement

Answer

Your question would be likelier to get helpful answers if you took the trouble to post working code, and if it were clear from the title of your question what you are trying to do. Your title says you want to find a value but your code is assigning a value.

JavaScript

Output:

JavaScript

Now this answer may be not what you meant at all. If not, try editing your question to explain whether you are trying to find values in a dictionary or assign them to a dictionary, ensure that the code you present actually works, and say clearly what output you expect.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement