<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>pylet</author_name>
  <author_url>https://blog.hatena.ne.jp/pylet/</author_url>
  <blog_title>pyletの日記</blog_title>
  <blog_url>https://pylet.hatenadiary.org/</blog_url>
  <categories>
    <anon>制御構文</anon>
  </categories>
  <description>Pythonはかなり*ふつう*の言語だなあという気がします。なので、「嫌い」という理由でPythonを使わない人はいたとしても、「わからない、難しい」という理由でPythonを使わない人は少ないのではないかと思います。そんな*ふつう*の言語Pythonの中でも、ちょっと驚いた点といえば、ループにelseがあることと、tryにelseがあることです。他の言語にあるのかな。 ループのelse ループのelseは、ループを正常に抜けた時にだけ実行します*1。正常に抜けた時というのは、ループの条件式が偽になって抜けた時なんかのことで、正常じゃないというのはbreakで抜けた時です。 &gt;&gt;&gt; for i…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpylet.hatenadiary.org%2Fentry%2F20060807%2F1154919350&quot; title=&quot;ループのelseとtryのelse - pyletの日記&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>2006-08-07 11:55:50</published>
  <title>ループのelseとtryのelse</title>
  <type>rich</type>
  <url>https://pylet.hatenadiary.org/entry/20060807/1154919350</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
