<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>minus9d</author_name>
  <author_url>https://blog.hatena.ne.jp/minus9d/</author_url>
  <blog_title>minus9d's diary</blog_title>
  <blog_url>https://minus9d.hatenablog.com/</blog_url>
  <categories>
    <anon>python</anon>
  </categories>
  <description>Pythonのforループやwhileループは、elseを持つことができると聞いて驚きました。例えば以下のコードは合法です。 for i in range(5): print(&quot;i = &quot;, i) else: print(&quot;loopは無事に終了しました&quot;) 実行例は以下です。 i = 0 i = 1 i = 2 i = 3 i = 4 loopは無事に終了しました このようにループの後に繋げたelseは、ループが正常終了したときのみ実行されます。逆に言うと、breakやreturnでループを抜けたり、例外を発生したりしたときは実行されません。 以下のようにループの途中でbreakすると、 fo…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fminus9d.hatenablog.com%2Fentry%2F2015%2F01%2F10%2F223110&quot; title=&quot;Pythonのループはelseを持てる - minus9d&amp;#39;s diary&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>2015-01-10 22:31:10</published>
  <title>Pythonのループはelseを持てる</title>
  <type>rich</type>
  <url>https://minus9d.hatenablog.com/entry/2015/01/10/223110</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
