{"image_url":null,"provider_name":"Hatena Blog","title":"UnboundLocalError: local variable '\u5909\u6570\u540d' referenced before assignment \u3063\u3066\u30a8\u30e9\u30fc","author_url":"https://blog.hatena.ne.jp/tmg1998/","author_name":"tmg1998","type":"rich","blog_url":"https://tmg0525.hatenadiary.jp/","published":"2017-08-18 23:40:48","width":"100%","url":"https://tmg0525.hatenadiary.jp/entry/2017/08/18/234048","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftmg0525.hatenadiary.jp%2Fentry%2F2017%2F08%2F18%2F234048\" title=\"UnboundLocalError: local variable &#39;\u5909\u6570\u540d&#39; referenced before assignment \u3063\u3066\u30a8\u30e9\u30fc - TIL\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","description":"\u5bfe\u5fdc\u3068\u3057\u3066\u306f\u95a2\u6570\u5185\u3067 global \u5909\u6570\u540d \u3068\u3059\u308b \u2193 \u8aac\u660e \u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u305f\u5834\u5408\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3057\u307e\u3046 >>> hoge = False >>> def foo(): ... hoge = False if hoge else True ... print(hoge) ... >>> foo() Traceback (most recent call last): File \"<stdin>\", line 1, in <module> File \"<stdin>\", line 2, in foo UnboundLocalError: local variable 'hoge' ref\u2026","version":"1.0","provider_url":"https://hatena.blog","categories":["Python"],"blog_title":"TIL"}