View Problem

Add an entry to a map

Given an empty pets map, add the mapping from "rob" to "dog"
DiskEdit
python
pets['rob'] = 'dog'
ExpandDiskEdit
cpp C++/CLI .NET 2.0
pets->Add("rob", "dog");
ExpandDiskEdit
cpp C++/CLI .NET 2.0
pets["rob"] = "dog";
DiskEdit
clojure
(assoc {} 'rob 'dog)

Submit a new solution for python, cpp, or clojure
There are 18 other solutions in additional languages (erlang, fantom, fsharp, go ...)