I'm an amateur programmer, and this seems like a simple problem to fix, but I just can't figure out how.
Below is C# code that isn't acting like I want it to. I expect for this to return 3, yet instead throws a KeyNotFoundException
. The Lists are the same, so shouldn't it be returning 3? Thanks for any help.
Dictionary<object, double> dict = new Dictionary<object, double>();
dict.Add(new List<object>() { "a", "b" }, 3);
double output = dict[new List<object>() { "a", "b" }];