With a simple dictionary like:
myDict{\'key1\':1, \'key2\':2}
I can safely use:
print myDict.get(\'key3\')
an
Use exceptions:
try: print myDict['key1']['attr3'] except KeyError: print "Can't find my keys"