<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tmg1998</author_name>
  <author_url>https://blog.hatena.ne.jp/tmg1998/</author_url>
  <blog_title>TIL</blog_title>
  <blog_url>https://tmg0525.hatenadiary.jp/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>対応としては関数内で global 変数名 とする ↓ 説明 以下のようなコードを実行した場合エラーが出てしまう &gt;&gt;&gt; hoge = False &gt;&gt;&gt; def foo(): ... hoge = False if hoge else True ... print(hoge) ... &gt;&gt;&gt; foo() Traceback (most recent call last): File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt; File &quot;&lt;stdin&gt;&quot;, line 2, in foo UnboundLocalError: local variable 'hoge' ref…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftmg0525.hatenadiary.jp%2Fentry%2F2017%2F08%2F18%2F234048&quot; title=&quot;UnboundLocalError: local variable &amp;#39;変数名&amp;#39; referenced before assignment ってエラー - TIL&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-08-18 23:40:48</published>
  <title>UnboundLocalError: local variable '変数名' referenced before assignment ってエラー</title>
  <type>rich</type>
  <url>https://tmg0525.hatenadiary.jp/entry/2017/08/18/234048</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
