{"width":"100%","version":"1.0","author_url":"https://blog.hatena.ne.jp/program-shoshinsya/","categories":["Python","yield"],"url":"https://program-shoshinsya.hatenablog.com/entry/2020/09/26/215836","author_name":"program-shoshinsya","type":"rich","blog_url":"https://program-shoshinsya.hatenablog.com/","height":"190","blog_title":"au\u306e\u65e5\u8a18","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fprogram-shoshinsya.hatenablog.com%2Fentry%2F2020%2F09%2F26%2F215836\" title=\"Python\u306eyield\u3063\u3066\u306a\u3093\u3060 - au\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog","title":"Python\u306eyield\u3063\u3066\u306a\u3093\u3060","image_url":null,"description":"au\u3067\u3059\u3002Python\u306e\u30b3\u30fc\u30c9\u306e\u4e2d\u306b\u300cyield\u300d\u304c\u51fa\u3066\u304d\u307e\u3057\u305f\u3002\u5206\u304b\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u8abf\u3079\u3066\u307f\u307e\u3059\u3002 yield\u3068\u306f yield\u3068\u306f\u3001\u95a2\u6570\u3092\u4e00\u6642\u7684\u306b\u505c\u6b62\u3059\u308b\u6a5f\u80fd\u3092\u6301\u3064\u6587\u3067\u3059\u3002\u76f4\u8a33\u3060\u3068\u300c\u3082\u305f\u3089\u3059\u3001\u751f\u3080\u3001\u8b72\u6e21\u3059\u308b\u300d\u3068\u3044\u3046\u610f\u5473\u304c\u3042\u308a\u307e\u3059\u3002return\u304c\u3001\u95a2\u6570\u3092\u7d42\u4e86\u3059\u308b\u306e\u306b\u5bfe\u3057\u3066\u3001yield\u306f\u9014\u4e2d\u306e\u5024\u3092\u8fd4\u3057\u3066\u4e2d\u65ad\u3059\u308b\u611f\u3058\u3067\u3059\u3002\u5b9f\u969b\u306b\u66f8\u3044\u3066\u307f\u307e\u3059\u3002 def test_yield(a, b): c = a + b yield c d = c * c yield d result_yield = test_yield(1, 2) print(result_yield) # <generator object \u2026","provider_url":"https://hatena.blog","published":"2020-09-26 21:58:36"}