{"type":"rich","provider_name":"Hatena Blog","author_name":"CortYuming","width":"100%","url":"https://cortyuming.hateblo.jp/entry/20081208/p4","title":"Python \u306e get \u3068 setdefault \u3092\u5c11\u3005\u4f7f\u3063\u3066\u307f\u305f","blog_url":"https://cortyuming.hateblo.jp/","height":"190","categories":["Python"],"description":"\u300eueBLOG | Python3000\u6b63\u5f0f\u30ea\u30ea\u30fc\u30b9\u3057\u305f\u306e\u3067\u622f\u308c\u3066\u307f\u308b\u300f\u3055\u3093\u306e\u3068\u3053\u3067 setdefault \u304c\u4fbf\u5229\u305d\u3046\u3060\u3063\u305f\u304b\u3089\u3001Python \u30e9\u30a4\u30d6\u30e9\u30ea\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9 \u3092\u898b\u3066\u307f\u305f\u3089\u3001\u4f3c\u305f\u69d8\u306a get \u304c\u3042\u3063\u305f\u306e\u3067\u5c11\u3005\u4f7f\u3063\u3066\u307f\u305f Python \u30e9\u30a4\u30d6\u30e9\u30ea\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9 3.8 \u30de\u30c3\u30d7\u578b \u304a\u8a66\u3057 >>> dic = {} >>> dic.get(1, \"empty\") #dic \u306e\u4e2d\u306b\u30ad\u30fc\u300c1\u300d\u304c\u306a\u3051\u308c\u3070 \"empty\" \u3092\u8868\u793a 'empty' >>> dic {} >>> [dic.setdefault(i, str(i)) for i in range(5)] #\u30ad\u30fc\u304c\u3042\u308c\u3070\u305d\u308c\u3092\u8fd4\u3057\u3066\u7121\u3051\u308c\u3070\u2026","provider_url":"https://hatena.blog","version":"1.0","published":"2008-12-08 00:00:00","author_url":"https://blog.hatena.ne.jp/CortYuming/","image_url":null,"blog_title":"\u724c\u8a9e\u5099\u5fd8\u9332 -pygo","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcortyuming.hateblo.jp%2Fentry%2F20081208%2Fp4\" title=\"Python \u306e get \u3068 setdefault \u3092\u5c11\u3005\u4f7f\u3063\u3066\u307f\u305f - \u724c\u8a9e\u5099\u5fd8\u9332 -pygo\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>"}