{"url":"https://y0m0r.hateblo.jp/entry/20111213/1323783159","published":"2011-12-13 22:32:39","provider_name":"Hatena Blog","author_url":"https://blog.hatena.ne.jp/yuheiomori0718/","image_url":null,"blog_title":"\u30e1\u30e2\u7f6e\u304d\u5834","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fy0m0r.hateblo.jp%2Fentry%2F20111213%2F1323783159\" title=\"ruby\u3001python\u306e\u30cf\u30c3\u30b7\u30e5/\u8f9e\u66f8\u306e\u5024\u53d6\u5f97 - \u30e1\u30e2\u7f6e\u304d\u5834\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","title":"ruby\u3001python\u306e\u30cf\u30c3\u30b7\u30e5/\u8f9e\u66f8\u306e\u5024\u53d6\u5f97","author_name":"yuheiomori0718","blog_url":"https://y0m0r.hateblo.jp/","type":"rich","categories":["python","ruby"],"provider_url":"https://hatena.blog","version":"1.0","height":"190","description":"ruby\u306b\u3070\u304b\u308a\u6163\u308c\u3066\u3044\u305f\u306e\u3067\u3001python\u306e\u8f9e\u66f8\u304b\u3089\u5024\u3092\u53d6\u5f97\u3057\u3088\u3046\u3068\u3057\u3066\u3001\u30ad\u30fc\u304c\u306a\u3044\u5834\u5408\u306bError\u306b\u306a\u308b\u3053\u3068\u306b\u3001\u3061\u3087\u3063\u3068\u3060\u3051\u3068\u307e\u3069\u3044\u307e\u3057\u305f\u3002 \u305b\u3063\u304b\u304f\u306a\u306e\u3067\u30cf\u30c3\u30b7\u30e5/\u8f9e\u66f8\u306e\u6271\u3044\u65b9\u306e\u30e1\u30e2\u3092\u6b8b\u3057\u3066\u304a\u304d\u307e\u3059\u3002 python my_dict = {\"a\": 1, \"b\": 2} # \u5024\u306e\u53d6\u5f97 print(my_dict[\"a\"]) # => 1 # \u30ad\u30fc\u304c\u306a\u3044\u5834\u5408\u3001KeyError\u304c\u767a\u751f\u3059\u308b try: print(my_dict[\"c\"]) except: print(\"KeyError\") # => KeyError # \u3042\u3089\u304b\u3058\u3081key\u304c\u3042\u308b\u304b\u8abf\u3079\u308b\u306b\u306fhas_key if my_dict.h\u2026"}