View Problem

Check if a key exists in a map

Given a map pets {joe:cat,mary:turtle,bill:canary} print "ok" if an pet exists for "mary"
DiskEdit
python
pets = dict(joe='cat', mary='turtle', bill='canary')
if ("mary" in pets) print "ok"

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