Use 'key in dict' instead of 'dict.has_key(key)'