{"blog_title":"\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30b9\u30bf\u30fc\u30c6\u30a3\u30f3\u30b0\u30ce\u30fc\u30c8","title":"\u3010Python\u3011\u4e09\u9805\u6f14\u7b97\u5b50\u3092\u4f7f\u3063\u3066\u5947\u6570\u3001\u5076\u6570\u3092\u5224\u5b9a\u3059\u308b","published":"2024-03-26 00:00:00","image_url":null,"author_url":"https://blog.hatena.ne.jp/itlabo/","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.flavor-of-life.com%2Fentry%2Fhow_to_python_ternary_operator\" title=\"\u3010Python\u3011\u4e09\u9805\u6f14\u7b97\u5b50\u3092\u4f7f\u3063\u3066\u5947\u6570\u3001\u5076\u6570\u3092\u5224\u5b9a\u3059\u308b - \u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30b9\u30bf\u30fc\u30c6\u30a3\u30f3\u30b0\u30ce\u30fc\u30c8\" 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://www.flavor-of-life.com/","provider_name":"Hatena Blog","author_name":"itlabo","categories":["Python"],"height":"190","version":"1.0","width":"100%","url":"https://www.flavor-of-life.com/entry/how_to_python_ternary_operator","description":"\u306f\u3058\u3081\u306b Python\u3067if\u6587\u3092\u66f8\u3044\u3066\u3044\u308b\u3068\u5358\u7d14\u306a\u30b3\u30fc\u30c9\u306a\u306e\u306b\u9577\u3044\u30b3\u30fc\u30c9\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002 \u5358\u7d14\u306a\u30b3\u30fc\u30c9\u306f\u4e09\u9805\u6f14\u7b97\u5b50\u306b\u3057\u3066\u8996\u8a8d\u6027\u306e\u826f\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u307f\u307e\u305b\u3093\u304b\uff1f \u4e09\u9805\u6f14\u7b97\u5b50\u3092\u4f7f\u3063\u3066\u5947\u6570\u3001\u5076\u6570\u3092\u5224\u5b9a\u3059\u308b \u4f8b\u3068\u3057\u3066\u4e09\u9805\u6f14\u7b97\u5b50\u3092\u4f7f\u3063\u3066\u5947\u6570\u3001\u5076\u6570\u3092\u5224\u5b9a\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092Python\u3067\u66f8\u3044\u3066\u307f\u307e\u3057\u3087\u3046\u3002 x = 1 y = '\u5076\u6570' if x % 2 == 0 else '\u5947\u6570' print(y) // \u5947\u6570 x = 2 y = '\u5076\u6570' if x % 2 == 0 else '\u5947\u6570' print(y) // \u5076\u6570 \u3068\u3066\u3082\u77ed\u304fif\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002 \u3053\u306ePython\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u610f\u5473\u306f\u4e0b\u8a18\u3067\u3059\u3002\u2026","type":"rich"}