{"image_url":null,"width":"100%","blog_url":"https://python-remrin.hatenadiary.jp/","categories":["python"],"height":"190","type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpython-remrin.hatenadiary.jp%2Fentry%2F2017%2F05%2F22%2F114416\" title=\"\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf - Remrin\u306epython\u653b\u7565\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>","description":"\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u306b\u3064\u3044\u3066\u3002 \u901a\u5e38\u306e\u95a2\u6570\u306ereturn\u306e\u90e8\u5206\u3092yield\u3068\u3059\u308b\u3068\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3092\u81ea\u4f5c\u3067\u304d\u308b\u3002 \u5076\u6570\u3092\u751f\u6210\u3059\u308b\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf def gene(): even = 0 while True: yield even even += 2 e = gene() for i in range(5): print(next(e)) \u7d20\u6570\u3092\u751f\u6210\u3059\u308b\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf def gen2(start=2, stop=1000000): pr = max(1, start - 1) while True: while pr < stop: pr += 1 if all(pr%x != 0 for x in ran\u2026","published":"2017-05-22 11:44:16","url":"https://python-remrin.hatenadiary.jp/entry/2017/05/22/114416","author_name":"rare_Remrin","provider_name":"Hatena Blog","provider_url":"https://hatena.blog","blog_title":"Remrin\u306epython\u653b\u7565\u65e5\u8a18","author_url":"https://blog.hatena.ne.jp/rare_Remrin/","version":"1.0","title":"\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf"}