<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>program-shoshinsya</author_name>
  <author_url>https://blog.hatena.ne.jp/program-shoshinsya/</author_url>
  <blog_title>auの日記</blog_title>
  <blog_url>https://program-shoshinsya.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
    <anon>yield</anon>
  </categories>
  <description>auです。Pythonのコードの中に「yield」が出てきました。分からなかったので調べてみます。 yieldとは yieldとは、関数を一時的に停止する機能を持つ文です。直訳だと「もたらす、生む、譲渡する」という意味があります。returnが、関数を終了するのに対して、yieldは途中の値を返して中断する感じです。実際に書いてみます。 def test_yield(a, b): c = a + b yield c d = c * c yield d result_yield = test_yield(1, 2) print(result_yield) # &lt;generator object …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fprogram-shoshinsya.hatenablog.com%2Fentry%2F2020%2F09%2F26%2F215836&quot; title=&quot;Pythonのyieldってなんだ - auの日記&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>2020-09-26 21:58:36</published>
  <title>Pythonのyieldってなんだ</title>
  <type>rich</type>
  <url>https://program-shoshinsya.hatenablog.com/entry/2020/09/26/215836</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
