{"provider_url":"https://hatena.blog","provider_name":"Hatena Blog","blog_url":"https://yohhoy.hatenadiary.jp/","author_name":"yohhoy","width":"100%","title":"\u30ea\u30b9\u30c8\u5185\u5305\u8868\u8a18\u4e2d\u306eif-else\u69cb\u6587","image_url":null,"description":"Python\u306e\u30ea\u30b9\u30c8\u5185\u5305\u8868\u8a18\u3067if-else\u69cb\u6587\u3092\u4f7f\u3046\u3068\u304d\u306e\u30e1\u30e2\u3002if\u306e\u307f\u3068\u306e\u8a18\u8ff0\u5834\u6240\u306e\u9055\u3044\u306b\u6ce8\u610f\u3002 a = [1, 2, 3, 4] [x for x in a if x < 2] # [3, 4] [x if x % 2 == 0 else 0 for x in a] # [0, 2, 0, 4] [x if x % 2 == 0 else 0 for x in a if 2 < x] # [0, 4] # \u4ee5\u4e0b\u306f\u3044\u305a\u308c\u3082 SyntaxError [x if x < 2 for x in a] [x for x in a if x % 2 == 0 else 0] \u95a2\u9023URL python\u2026","blog_title":"yohhoy\u306e\u65e5\u8a18","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohhoy.hatenadiary.jp%2Fentry%2F20150325%2Fp1\" title=\"\u30ea\u30b9\u30c8\u5185\u5305\u8868\u8a18\u4e2d\u306eif-else\u69cb\u6587 - yohhoy\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>","published":"2015-03-25 00:00:00","version":"1.0","categories":["Python"],"type":"rich","url":"https://yohhoy.hatenadiary.jp/entry/20150325/p1","author_url":"https://blog.hatena.ne.jp/yohhoy/","height":"190"}