{"provider_name":"Hatena Blog","image_url":null,"url":"https://inamori.hateblo.jp/entry/20081119/p1","categories":["Python"],"author_name":"inamori","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Finamori.hateblo.jp%2Fentry%2F20081119%2Fp1\" title=\"\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\uff082\uff09 - inamori\u2019s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://inamori.hateblo.jp/","type":"rich","title":"\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\uff082\uff09","version":"1.0","height":"190","description":"\u524d\u56de\u306f\u7121\u9650\u306b\u7d9a\u304f\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3092\u7d39\u4ecb\u3057\u305f\u304c\u3001\u4eca\u56de\u306f\u6253\u3061\u5207\u308b\u306e\u3092\u3002 def count(n): i = 0 while i yield i i += 1for i in count(3): print i, 0 1 2\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u304c\u95a2\u6570\u306e\u6700\u5f8c\u307e\u3067\u884c\u304f\u3068\u3001StopIteration\u3068\u3044\u3046\u4f8b\u5916\u3092\u6295\u3052\u308b\u3002\u3053\u308c\u306f\u3001\u6b21\u306e\u30b3\u30fc\u30c9\u3067\u5b9f\u8a3c\u3055\u308c\u308b\u3002 def count(n): i = 0 while i yield i i += 1c = count(3) while True: try: print c.next(), except StopIteration: break\u4f8b\u5916\u306f\u3001\u4e0a\u306e\u3088\u3046\u306b try \u301c exce\u2026","blog_title":"inamori\u2019s diary","author_url":"https://blog.hatena.ne.jp/inamori/","width":"100%","published":"2008-11-19 00:00:00","provider_url":"https://hatena.blog"}